-
-
Save Peeja/4198528 to your computer and use it in GitHub Desktop.
RSpec rcov task does not work
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Foo | |
def self.number | |
8 | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rspec' | |
require File.expand_path('../foo', __FILE__) | |
describe Foo do | |
describe '.number' do | |
it 'is 9' do | |
Foo.number.should == 9 | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source :rubygems | |
gem 'rake' | |
gem 'rspec', '2.12.0' | |
gem 'rcov' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ bundle show | |
Gems included by the bundle: | |
* bundler (1.1.rc) | |
* diff-lcs (1.1.3) | |
* rake (0.9.2) | |
* rcov (0.9.11) | |
* rspec (2.7.0) | |
* rspec-core (2.7.0) | |
* rspec-expectations (2.7.0) | |
* rspec-mocks (2.7.0) | |
$ bundle exec rake spec | |
/Users/rsutphin/.rvm/rubies/ruby-1.8.7-p352/bin/ruby -S rspec foo_spec.rb | |
F | |
Failures: | |
1) Foo.number is 9 | |
Failure/Error: Foo.number.should == 9 | |
expected: 9 | |
got: 8 (using ==) | |
# ./foo_spec.rb:8 | |
Finished in 0.07978 seconds | |
1 example, 1 failure | |
Failed examples: | |
rspec ./foo_spec.rb:7 # Foo.number is 9 | |
rake aborted! | |
ruby /Users/rsutphin/.rvm/rubies/ruby-1.8.7-p352/bin/ruby -S rspec foo_spec.rb failed | |
Tasks: TOP => spec | |
(See full trace by running task with --trace) | |
$ bundle exec rake spec:rcov | |
/Users/rsutphin/.rvm/rubies/ruby-1.8.7-p352/bin/ruby -S rcov -Ispec:lib foo_spec.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rspec/core/rake_task' | |
desc "Run all specs" | |
RSpec::Core::RakeTask.new('spec') do |t| | |
t.pattern = 'foo_spec.rb' | |
t.verbose = true | |
end | |
desc "Run all specs with rcov" | |
RSpec::Core::RakeTask.new('spec:rcov') do |t| | |
t.pattern = 'foo_spec.rb' | |
t.verbose = true | |
t.rcov = true | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment