diff options
Diffstat (limited to 'spec/ruby/core/string/shared')
-rw-r--r-- | spec/ruby/core/string/shared/concat.rb | 12 | ||||
-rw-r--r-- | spec/ruby/core/string/shared/replace.rb | 8 | ||||
-rw-r--r-- | spec/ruby/core/string/shared/succ.rb | 6 |
3 files changed, 13 insertions, 13 deletions
diff --git a/spec/ruby/core/string/shared/concat.rb b/spec/ruby/core/string/shared/concat.rb index 7da995fdc7..d7b9cdfec3 100644 --- a/spec/ruby/core/string/shared/concat.rb +++ b/spec/ruby/core/string/shared/concat.rb @@ -17,12 +17,12 @@ describe :string_concat, shared: true do lambda { 'hello '.send(@method, mock('x')) }.should raise_error(TypeError) end - it "raises a RuntimeError when self is frozen" do + it "raises a #{frozen_error_class} when self is frozen" do a = "hello" a.freeze - lambda { a.send(@method, "") }.should raise_error(RuntimeError) - lambda { a.send(@method, "test") }.should raise_error(RuntimeError) + lambda { a.send(@method, "") }.should raise_error(frozen_error_class) + lambda { a.send(@method, "test") }.should raise_error(frozen_error_class) end it "returns a String when given a subclass instance" do @@ -87,12 +87,12 @@ describe :string_concat, shared: true do lambda { "".send(@method, x) }.should raise_error(TypeError) end - it "raises a RuntimeError when self is frozen" do + it "raises a #{frozen_error_class} when self is frozen" do a = "hello" a.freeze - lambda { a.send(@method, 0) }.should raise_error(RuntimeError) - lambda { a.send(@method, 33) }.should raise_error(RuntimeError) + lambda { a.send(@method, 0) }.should raise_error(frozen_error_class) + lambda { a.send(@method, 33) }.should raise_error(frozen_error_class) end end end diff --git a/spec/ruby/core/string/shared/replace.rb b/spec/ruby/core/string/shared/replace.rb index 9f5446fbbe..a583b88b5a 100644 --- a/spec/ruby/core/string/shared/replace.rb +++ b/spec/ruby/core/string/shared/replace.rb @@ -62,14 +62,14 @@ describe :string_replace, shared: true do lambda { "hello".send(@method, mock('x')) }.should raise_error(TypeError) end - it "raises a RuntimeError on a frozen instance that is modified" do + it "raises a #{frozen_error_class} on a frozen instance that is modified" do a = "hello".freeze - lambda { a.send(@method, "world") }.should raise_error(RuntimeError) + lambda { a.send(@method, "world") }.should raise_error(frozen_error_class) end # see [ruby-core:23666] - it "raises a RuntimeError on a frozen instance when self-replacing" do + it "raises a #{frozen_error_class} on a frozen instance when self-replacing" do a = "hello".freeze - lambda { a.send(@method, a) }.should raise_error(RuntimeError) + lambda { a.send(@method, a) }.should raise_error(frozen_error_class) end end diff --git a/spec/ruby/core/string/shared/succ.rb b/spec/ruby/core/string/shared/succ.rb index 4854cb7146..0ab659864d 100644 --- a/spec/ruby/core/string/shared/succ.rb +++ b/spec/ruby/core/string/shared/succ.rb @@ -81,8 +81,8 @@ describe :string_succ_bang, shared: true do end end - it "raises a RuntimeError if self is frozen" do - lambda { "".freeze.send(@method) }.should raise_error(RuntimeError) - lambda { "abcd".freeze.send(@method) }.should raise_error(RuntimeError) + it "raises a #{frozen_error_class} if self is frozen" do + lambda { "".freeze.send(@method) }.should raise_error(frozen_error_class) + lambda { "abcd".freeze.send(@method) }.should raise_error(frozen_error_class) end end |