开发者

RSpec and testing Rails Gem

I'm trying to set a testing framework for a rails engine. I have everything working, I generated the corresponding rspec file with:

rails g rspec:install

However everytime I want to add a rspec testing file with:

rails g integration_test blah

The RSpec doesn't take over and instead the standard unit testing framework of rails cre开发者_如何学Pythonates the corresponding files. Any thoughts on where the problem might be?


I solved that problem running rails g with --integration-tools option

rails g integration_test blah --integration-tools=rspec

I do not know how to set rspec as default tool.


I always add in my application.rb :

config.generators do |g|
  g.test_framework :rspec
end

That allows RSpec to replace Rails generator for tests.


you should put in application.rb:

    config.generators do |g|
      g.integration_tool :rspec
      g.test_framework :rspec
    end

source: rails configuration guide

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜