mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@9277d27
This commit is contained in:
parent
ce986b41ca
commit
201d501640
17 changed files with 209 additions and 6 deletions
|
@ -5,11 +5,13 @@ describe 'Coverage.result' do
|
|||
before :all do
|
||||
@class_file = fixture __FILE__, 'some_class.rb'
|
||||
@config_file = fixture __FILE__, 'start_coverage.rb'
|
||||
@eval_code_file = fixture __FILE__, 'eval_code.rb'
|
||||
end
|
||||
|
||||
after :each do
|
||||
$LOADED_FEATURES.delete(@class_file)
|
||||
$LOADED_FEATURES.delete(@config_file)
|
||||
$LOADED_FEATURES.delete(@eval_code_file)
|
||||
end
|
||||
|
||||
it 'gives the covered files as a hash with arrays of count or nil' do
|
||||
|
@ -75,4 +77,16 @@ describe 'Coverage.result' do
|
|||
require @config_file.chomp('.rb')
|
||||
Coverage.result.should_not include(@config_file)
|
||||
end
|
||||
|
||||
it 'returns the correct results when eval is used' do
|
||||
Coverage.start
|
||||
require @eval_code_file.chomp('.rb')
|
||||
result = Coverage.result
|
||||
|
||||
result.should == {
|
||||
@eval_code_file => [
|
||||
1, nil, 1, nil, 1, nil, nil, nil, nil, nil, 1
|
||||
]
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue