3

I installed simplecov gem and added

require 'simplecov'  
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

Andrew Grimm
  • 78,473
  • 57
  • 200
  • 338
Konstantin
  • 41
  • 1
  • 4

3 Answers3

1

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

Konstantin
  • 41
  • 1
  • 4
1

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

ravikiran
  • 11
  • 1
0

Verify you are using the needed gemset

Tomás Lima
  • 313
  • 2
  • 9