diff options
author | Benoit Daloze <eregontp@gmail.com> | 2019-04-27 18:53:23 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2019-04-27 18:53:23 +0200 |
commit | a1b4816759418ca8fe510e8739622fc5d77ab0f0 (patch) | |
tree | 9d4fb6091d0086817f5bde46bf1150e9130d34fd /spec/ruby/library/coverage | |
parent | 00c33d9c232ed1a79eda17acd7231ac93caa162b (diff) | |
download | ruby-a1b4816759418ca8fe510e8739622fc5d77ab0f0.tar.gz |
Update to ruby/spec@15c9619
Diffstat (limited to 'spec/ruby/library/coverage')
-rw-r--r-- | spec/ruby/library/coverage/fixtures/spec_helper.rb | 11 | ||||
-rw-r--r-- | spec/ruby/library/coverage/peek_result_spec.rb | 1 | ||||
-rw-r--r-- | spec/ruby/library/coverage/result_spec.rb | 15 |
3 files changed, 7 insertions, 20 deletions
diff --git a/spec/ruby/library/coverage/fixtures/spec_helper.rb b/spec/ruby/library/coverage/fixtures/spec_helper.rb deleted file mode 100644 index 19094e5c36..0000000000 --- a/spec/ruby/library/coverage/fixtures/spec_helper.rb +++ /dev/null @@ -1,11 +0,0 @@ -module CoverageSpecs - # Clear old results from the result hash - # https://bugs.ruby-lang.org/issues/12220 - def self.filtered_result - result = Coverage.result - ruby_version_is ""..."2.4" do - result = result.reject { |_k, v| v.empty? } - end - result - end -end diff --git a/spec/ruby/library/coverage/peek_result_spec.rb b/spec/ruby/library/coverage/peek_result_spec.rb index 897fc4d978..9d7c890faa 100644 --- a/spec/ruby/library/coverage/peek_result_spec.rb +++ b/spec/ruby/library/coverage/peek_result_spec.rb @@ -1,5 +1,4 @@ require_relative '../../spec_helper' -require fixture __FILE__, 'spec_helper' require 'coverage' describe 'Coverage.peek_result' do diff --git a/spec/ruby/library/coverage/result_spec.rb b/spec/ruby/library/coverage/result_spec.rb index f964c9457a..ebfa5538b4 100644 --- a/spec/ruby/library/coverage/result_spec.rb +++ b/spec/ruby/library/coverage/result_spec.rb @@ -1,5 +1,4 @@ require_relative '../../spec_helper' -require fixture __FILE__, 'spec_helper' require 'coverage' describe 'Coverage.result' do @@ -16,7 +15,7 @@ describe 'Coverage.result' do it 'gives the covered files as a hash with arrays of count or nil' do Coverage.start require @class_file.chomp('.rb') - result = CoverageSpecs.filtered_result + result = Coverage.result result.should == { @class_file => [ @@ -27,7 +26,7 @@ describe 'Coverage.result' do it 'no requires/loads should give empty hash' do Coverage.start - result = CoverageSpecs.filtered_result + result = Coverage.result result.should == {} end @@ -43,11 +42,11 @@ describe 'Coverage.result' do it 'second run should give same result' do Coverage.start load @class_file - result1 = CoverageSpecs.filtered_result + result1 = Coverage.result Coverage.start load @class_file - result2 = CoverageSpecs.filtered_result + result2 = Coverage.result result2.should == result1 end @@ -58,7 +57,7 @@ describe 'Coverage.result' do Coverage.result Coverage.start - result = CoverageSpecs.filtered_result + result = Coverage.result result.should == {} end @@ -66,13 +65,13 @@ describe 'Coverage.result' do it 'second Coverage.start does nothing' do Coverage.start require @config_file.chomp('.rb') - result = CoverageSpecs.filtered_result + result = Coverage.result result.should == { @config_file => [1, 1, 1] } end it 'does not include the file starting coverage since it is not tracked' do require @config_file.chomp('.rb') - CoverageSpecs.filtered_result.should_not include(@config_file) + Coverage.result.should_not include(@config_file) end end |