Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
我的两分钱:
用牛排代替黄瓜。它的核心是 RSpec,它很简单并且可以完成工作。
https://github.com/cavalle/steak
Capybara 允许您使用不同的驱动程序。一些驱动程序支持 javascript,使用浏览器运行,更快,更慢等。使用适合您正在使用 Swinger 测试的规范的最佳驱动程序:
https://github.com/jeffkreeftmeijer/swinger
我使用我自己的 Akephalos 分支 - 一个驱动程序 - 它速度快,支持 javascript、UTF-8 (这就是我的分支添加的)并且不需要外部浏览器。
https://github.com/Nerian/akephalos2
RSpec 的一个好习惯是使用“Context”。问我是否需要澄清。另外,请注意 let 方法。它返回块返回的任何内容。它对于在内部声明模拟对象并在示例上使用它们非常有用。 。
另外,Pragmatic Programmers 的《The RSpec Book》这本书是一个非常好的资源,可以帮助您了解 RSpec、Capybara、Cucumber 和所有这些行为驱动开发敏捷事物背后的核心概念:)
编辑:
另外,我使用 Machinist2 作为固定装置。
https://github.com/notahat/machinist
效果很好。比工厂女孩好。
还有 Fabricator,它有一个很棒的网站和一个非常有用的 DSL。
https://github.com/paulelliott/fabrication
您可以使用 Machinist 与 Forgery 来创建智能数据。
https://github.com/sevenwire/forgery
您可以将其与 Thor 任务结合起来以填充您开发数据库,以最终用户看到的方式查看应用程序。
RSpec 2 的文档有很多示例:
http://relishapp.com/rspec
另外,这篇文章还提供了许多其他示例提示:
http://eggsonbread.com/2010/ 03/28/my-rspec-best-practices-and-tips/
另一篇文章提供了非常好的建议:
http://flux88.com/2011/05/dry-up-your-rspec-files-with-subject-let-blocks/< /a>
优化测试的执行时间:
http://blog .leshill.org/blog/2011/10/23/fast-specs.html
http://jeffkreeftmeijer.com/2011/spec-helpers-bundler-setup-faster-rails-test-suites/
My 2 cents:
Use Steak instead of Cucumber. It RSpec at its core, it is simple and it does the job.
https://github.com/cavalle/steak
Capybara allow you use different drivers. Some drivers support javascript, run with a browser, faster, slower, etc. Use the best Driver for the spec you are testing using Swinger:
https://github.com/jeffkreeftmeijer/swinger
I use my own fork of Akephalos – a driver – which is fast, support javascript, UTF-8 (that's what my fork adds) and doesn't need an external browser.
https://github.com/Nerian/akephalos2
A good practice for RSpec is to use 'Context'. Ask me if you need clarification. Also, take note of the let method. It returns whatever the block returns. It is useful for declaring mock a object inside and using them on the samples. .
Also, the book: The RSpec Book, of Pragmatic Programmers is a very good resource for initiating yourself about the core concepts behind RSpec, Capybara, Cucumber and all this Behaviour Driven Development agile thing :)
Edit:
Also, I use Machinist2 for fixtures.
https://github.com/notahat/machinist
Works great. Better than Factory girl.
There is also Fabricator, which have an excellent website and a very usable DSL.
https://github.com/paulelliott/fabrication
You can use Machinist with Forgery in order to create intelligent data.
https://github.com/sevenwire/forgery
You can combine this with a Thor task in order to populate you development database, to see the application as the final user would see it.
The documentation of RSpec 2 has many examples:
http://relishapp.com/rspec
Also, this Post give many other tips:
http://eggsonbread.com/2010/03/28/my-rspec-best-practices-and-tips/
Another post with very good advise:
http://flux88.com/2011/05/dry-up-your-rspec-files-with-subject-let-blocks/
Optimising the execution time of tests:
http://blog.leshill.org/blog/2011/10/23/fast-specs.html
http://jeffkreeftmeijer.com/2011/spec-helpers-bundler-setup-faster-rails-test-suites/