-
-
Notifications
You must be signed in to change notification settings - Fork 390
Started adding spec for coverage #217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
2 + 2 | ||
Coverage.start | ||
1 + 1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require File.expand_path('../../../spec_helper', __FILE__) | ||
require 'coverage' | ||
|
||
describe 'Coverage.peek_result' do | ||
it 'needs to be reviewed for spec completeness' | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
require File.expand_path('../../../spec_helper', __FILE__) | ||
require 'coverage' | ||
|
||
describe 'Coverage.result' do | ||
before :all do | ||
@config_file = fixture __FILE__, 'start_coverage.rb' | ||
end | ||
|
||
after :each do | ||
$LOADED_FEATURES.delete(@config_file) | ||
end | ||
|
||
it 'gives the covered files as a hash with arrays' do | ||
Coverage.start | ||
require @config_file.chomp('.rb') | ||
result = Coverage.result | ||
|
||
result.should == { @config_file => [1, 1, 1] } | ||
end | ||
|
||
it 'should list coverage for the required file starting coverage' do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think there should be a spec mentioning that coverage is only tracked for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And maybe one about the fact that |
||
require @config_file.chomp('.rb') | ||
result = Coverage.result | ||
|
||
result.should == { @config_file => [] } | ||
end | ||
|
||
it 'should list coverage for the loaded file starting coverage' do | ||
load @config_file | ||
result = Coverage.result | ||
|
||
result.should == { @config_file => [] } | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require File.expand_path('../../../spec_helper', __FILE__) | ||
require 'coverage' | ||
|
||
describe 'Coverage.start' do | ||
it 'needs to be reviewed for spec completeness' | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the Coverage.start does here? It seems only line 1 is reported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is to test coverage for the file that calls Coverage.start.