summaryrefslogtreecommitdiff
path: root/spec/ruby/library/coverage
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/coverage')
-rw-r--r--spec/ruby/library/coverage/result_spec.rb4
-rw-r--r--spec/ruby/library/coverage/start_spec.rb6
-rw-r--r--spec/ruby/library/coverage/supported_spec.rb6
3 files changed, 8 insertions, 8 deletions
diff --git a/spec/ruby/library/coverage/result_spec.rb b/spec/ruby/library/coverage/result_spec.rb
index 0101eb6a64..2e7d598bb8 100644
--- a/spec/ruby/library/coverage/result_spec.rb
+++ b/spec/ruby/library/coverage/result_spec.rb
@@ -80,7 +80,7 @@ describe 'Coverage.result' do
Coverage.result
-> {
Coverage.result
- }.should raise_error(RuntimeError, 'coverage measurement is not enabled')
+ }.should.raise(RuntimeError, 'coverage measurement is not enabled')
end
it 'second run should give same result' do
@@ -108,7 +108,7 @@ describe 'Coverage.result' do
it 'does not include the file starting coverage since it is not tracked' do
require @config_file.chomp('.rb')
- Coverage.result.should_not include(@config_file)
+ Coverage.result.should_not.include?(@config_file)
end
it 'returns the correct results when eval coverage is enabled' do
diff --git a/spec/ruby/library/coverage/start_spec.rb b/spec/ruby/library/coverage/start_spec.rb
index c921b85401..11777347a2 100644
--- a/spec/ruby/library/coverage/start_spec.rb
+++ b/spec/ruby/library/coverage/start_spec.rb
@@ -24,7 +24,7 @@ describe 'Coverage.start' do
-> {
Coverage.start
- }.should raise_error(RuntimeError, 'coverage measurement is already setup')
+ }.should.raise(RuntimeError, 'coverage measurement is already setup')
end
it "accepts :all optional argument" do
@@ -65,13 +65,13 @@ describe 'Coverage.start' do
it "expects a Hash if not passed :all" do
-> {
Coverage.start(42)
- }.should raise_error(TypeError, "no implicit conversion of Integer into Hash")
+ }.should.raise(TypeError, "no implicit conversion of Integer into Hash")
end
it "does not accept both lines: and oneshot_lines: keyword arguments" do
-> {
Coverage.start(lines: true, oneshot_lines: true)
- }.should raise_error(RuntimeError, "cannot enable lines and oneshot_lines simultaneously")
+ }.should.raise(RuntimeError, "cannot enable lines and oneshot_lines simultaneously")
end
it "enables the coverage measurement if passed options with `false` value" do
diff --git a/spec/ruby/library/coverage/supported_spec.rb b/spec/ruby/library/coverage/supported_spec.rb
index 9226548c1f..fcf8a76d79 100644
--- a/spec/ruby/library/coverage/supported_spec.rb
+++ b/spec/ruby/library/coverage/supported_spec.rb
@@ -17,14 +17,14 @@ describe "Coverage.supported?" do
it "raise TypeError if argument is not Symbol" do
-> {
Coverage.supported?("lines")
- }.should raise_error(TypeError, "wrong argument type String (expected Symbol)")
+ }.should.raise(TypeError, "wrong argument type String (expected Symbol)")
-> {
Coverage.supported?([])
- }.should raise_error(TypeError, "wrong argument type Array (expected Symbol)")
+ }.should.raise(TypeError, "wrong argument type Array (expected Symbol)")
-> {
Coverage.supported?(1)
- }.should raise_error(TypeError, "wrong argument type Integer (expected Symbol)")
+ }.should.raise(TypeError, "wrong argument type Integer (expected Symbol)")
end
end