-
-
Notifications
You must be signed in to change notification settings - Fork 388
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add spec to the result of Coverage lib for
begin
Ref: jruby/jruby#8173 This commit is intended to make sure `Coverage` library behaves the same for the code with `begin`. JRuby had an issue so this change will help JRuby and other implementations to avoid it.
- Loading branch information
1 parent
1afa2ea
commit b93d02a
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require_relative '../../spec_helper' | ||
require 'coverage' | ||
|
||
describe 'Coverage for the code with begin' do | ||
before :all do | ||
@file = fixture __FILE__, 'code_with_begin.rb' | ||
end | ||
|
||
after :each do | ||
$LOADED_FEATURES.delete(@file) | ||
end | ||
|
||
it 'covers 100% lines' do | ||
Coverage.start | ||
require @file.chomp('.rb') | ||
result = Coverage.result | ||
|
||
result.should == { | ||
@file => [ | ||
nil, 1, nil | ||
] | ||
} | ||
end | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
begin | ||
puts 'begin' | ||
end |