开发者

ruby rspec wont work with simplecov

I installed simplecov gem and added

require '开发者_StackOverflowsimplecov'  
SimpleCov.start

to the spec_helper.rb file, now if i include spec_helper.rb in my some_file_spec.rb file and try to run it i get this

c:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.1/lib/rspec/core/configuratio
n.rb:116:in `require': no such file to load -- rspec/core/mocking/with_rspec (Lo
adError)
        from c:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.1/lib/rspec/core
/configuration.rb:116:in `mock_framework'
        from c:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.1/lib/rspec/core
/configuration.rb:376:in `configure_mock_framework'
        from c:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.1/lib/rspec/core
/command_line.rb:19:in `run'
        from c:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.1/lib/rspec/core
/runner.rb:55:in `run_in_process'
        from c:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.1/lib/rspec/core
/runner.rb:46:in `run'
        from c:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.1/lib/rspec/core
/runner.rb:10:in `block in autorun'
Coverage report generated for c:/Ruby192/bin/rspec player_spec.rb to c:/Users/Ko
Le/Documents/NetBeansProjects/CHCGame/spec/coverage. 0.0% covered.

Everything works fine without the simplecov, but i need the code coverage data for my ruby class. Thanks in advance for any tips you can give me on this. I work under win7 32


I seem to have solved this by removing rspec and doing a bundle install of rspec and simplecov together. Hope this helps someone


add simplecov gem in gemfile and do bundle install.I think this will solve the problem


Verify you are using the needed gemset

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜