We are trying to use simplecov with rspec from within a rake task. we have tried in Windows and ubuntu, but it always shows 0.0%, like this:
root@ip-10-81-10-196:~# rake
/opt/rvm/rubies/ruby-1.9.2-head/bin/ruby -S rspec test_spec.rb
.
Finished in 0.00039 seconds
1 example, 0 failures
Coverage report generated for RSpec to /root/coverage. 0 / 0 LOC (0.0%) covered.
we are not using bundler, we installed simplecov 0.5.2 and rspec 2.6.0 via "gem install".
rakefile.rb has:
require 'simplecov'
SimpleCov.start
require 'rake'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = '*_spec.rb'
end
task :default => :spec
and test_spec.rb has:
require 'rspec'
class TestClass
attr_reader :text
def initialize(text)
@text = text
end
end
describe "a simple test" do
it "should be covered" do
test_class = TestClass.new('default text')
test_class.text.should == 'default text'
end
end
How do we make it work?
thank you so much,
Isel
We are trying to use simplecov with rspec from within a rake task. we have tried in Windows and ubuntu, but it always shows 0.0%, like this:
we are not using bundler, we installed simplecov 0.5.2 and rspec 2.6.0 via "gem install".
rakefile.rb has:
require 'simplecov'
SimpleCov.start
require 'rake'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = '*_spec.rb'
end
task :default => :spec
and test_spec.rb has:
require 'rspec'
class TestClass
attr_reader :text
end
describe "a simple test" do
it "should be covered" do
test_class = TestClass.new('default text')
test_class.text.should == 'default text'
end
end
How do we make it work?
thank you so much,
Isel