项目主页:http://expectations.rubyforge.org/
安装的话:gem install expectations
它将测试分为state based和behavior based,语法很DSL,作者写了篇文章《implementing internal dsl in ruby》
例子,
state base test:
# State based expectation where a value equals another value
expect 2 do
1 + 1
end
expect /a string/ do
"a string"
end
# State based test checking if actual is in the expected Range
expect 1..5 do
3
end
# State based test to determine if the object is an instance of the module
expect Enumerable do
[]
end
# State based test to determine if the object is an instance of the class
expect String do
"a string"
end
# State based test to determine if the modules are the same
expect Enumerable do
Enumerable
end
behavior based test:
# Behavior based test using a traditional mock
expect mock.to_receive(:dial).with("2125551212").times(2) do |phone|
phone.dial("2125551212")
phone.dial("2125551212")
end
# Behavior based test on a concrete mock
expect Object.to_receive(:deal) do
Object.deal
end
分享到:
- 2008-02-16 10:05
- 浏览 1649
- 评论(1)
- 论坛回复 / 浏览 (1 / 2028)
- 查看更多
相关推荐
Mockito是一个针对Java的mocking框架。它与EasyMock和jMock很相似,但是通过在执行后校验什么已经被调用,它消除了对期望行为(expectations)的需要。其它的mocking库需要你在执行前记录期望行为(expectations),...
JUnit是一个流行的Java测试框架,TestNG是一个功能强大且灵活的测试框架,PyUnit是一个Python测试框架,Selenium是一个自动化Web浏览器测试工具,Appium是一个自动化移动应用测试工具。 软件工程中还有一些其他重要...
寄予厚望 小型ES5断言框架经验 与运行 node test.js
资源分类:Python库 所属语言:Python 资源全名:great_expectations-0.13.31.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源来自pypi官网。 资源全名:great_expectations-0.9.1.tar.gz
目的是允许dbt用户直接从dbt在其数据仓库中部署类似于GE的测试,而不必与他们的数据仓库添加另一个集成。安装包含在packages.yml packages : - package : calogica/dbt_expectations version : [">=0.2.0", "<0> ...
名词解释部分对软件测试中的一些关键术语进行了定义和解释,包括黑盒测试、白盒测试、静态测试、动态测试、功能测试、集成测试、单元测试和性能测试等。 黑盒测试是一种测试方法,它对软件的内部结构和实现细节不...
资源分类:Python库 所属语言:Python 使用前提:需要解压 资源全名:great_expectations-0.7.7-py2.py3-none-any.whl 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
python库。 资源全名:airflow-provider-great-expectations-0.0.7.tar.gz
软件测试是软件开发过程中的一个关键步骤,它旨在确保软件产品满足用户的需求和expectations。软件测试方法和技术是软件测试中使用的各种方法和技术,以确保软件产品的质量和可靠性。 系统集成的模式是软件测试中的...
一个 leiningen 插件,用于使用库编写运行测试。 用法 对于莱宁根 2.0: 在project.clj声明lein-expectations : :plugins [[lein-expectations " 0.0.8 " ]] 对于 Leiningen 1.x - 使用 lein-expectations 0.0.5...
Great,Expectations英文读后感(远大前程)参考.doc
《Step By Step写测试》介绍使用 JTESTER 写单元测试,作者吴大瑞,pdf 格式,大小 1.8MB。本书带有 pdf 书签,方便读者阅读。 目录: Jtester的项目配置 1 TestNG测试 1.1 一个简单到不能再简单的测试 1.2 在...
设计用于 mocha,但适用于任何测试框架。安装NodeJS: npm install expectations 浏览器:手动下载,或bower install expectations用法节点: require('expectations');// exports a global, so use anywhere来自 ...
微小帮移动APP的设计和实现采用了轻量级J2EE框架,整合了Android+JD+Javaweb框架开发技术。该系统的设计开发主要分为三个部分:安卓开发平台上的前台安卓APP、云服务器上的Mysql数据库和作为中间层的Java Servlet。 ...
python库,解压后可用。 资源全名:great_expectations-0.8.3-py2.py3-none-any.whl
根据这个简历模板,我们可以看到,软件测试工程师的薪资 expectations 是 4500 元/月。 7. 软件测试工程师的工作时间 软件测试工程师的工作时间是什么?根据这个简历模板,我们可以看到,软件测试工程师可以随时到...
great_expectations_sample PostgreSQL期望示例项目 使用命令行参数提供表/视图名称。可用于在运行时创建动态命令 与python /path/to/uncommitted/chkpt-1.py patient一起运行 这也创建了文档和结果 对于任何ge cli...
它与IDE自动补全功能相得益彰: 测试失败会显示清晰且有用的消息:用法首先,将超出期望作为对单元测试的依赖项添加到您的项目中: dub.sdl : configuration "unittest" { dependency "exceeds-expectations" ...
Smart grid expectations [In My View]