summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/string')
-rw-r--r--spec/ruby/core/string/capitalize_spec.rb4
-rw-r--r--spec/ruby/core/string/chomp_spec.rb10
-rw-r--r--spec/ruby/core/string/chop_spec.rb8
-rw-r--r--spec/ruby/core/string/clear_spec.rb6
-rw-r--r--spec/ruby/core/string/delete_prefix_spec.rb8
-rw-r--r--spec/ruby/core/string/delete_spec.rb6
-rw-r--r--spec/ruby/core/string/delete_suffix_spec.rb8
-rw-r--r--spec/ruby/core/string/downcase_spec.rb6
-rw-r--r--spec/ruby/core/string/element_set_spec.rb4
-rw-r--r--spec/ruby/core/string/encode_spec.rb8
-rw-r--r--spec/ruby/core/string/force_encoding_spec.rb4
-rw-r--r--spec/ruby/core/string/gsub_spec.rb16
-rw-r--r--spec/ruby/core/string/insert_spec.rb6
-rw-r--r--spec/ruby/core/string/lstrip_spec.rb10
-rw-r--r--spec/ruby/core/string/prepend_spec.rb6
-rw-r--r--spec/ruby/core/string/reverse_spec.rb10
-rw-r--r--spec/ruby/core/string/rstrip_spec.rb10
-rw-r--r--spec/ruby/core/string/setbyte_spec.rb4
-rw-r--r--spec/ruby/core/string/shared/concat.rb12
-rw-r--r--spec/ruby/core/string/shared/replace.rb8
-rw-r--r--spec/ruby/core/string/shared/succ.rb6
-rw-r--r--spec/ruby/core/string/slice_spec.rb56
-rw-r--r--spec/ruby/core/string/squeeze_spec.rb6
-rw-r--r--spec/ruby/core/string/strip_spec.rb10
-rw-r--r--spec/ruby/core/string/sub_spec.rb16
-rw-r--r--spec/ruby/core/string/swapcase_spec.rb4
-rw-r--r--spec/ruby/core/string/tr_s_spec.rb8
-rw-r--r--spec/ruby/core/string/tr_spec.rb8
-rw-r--r--spec/ruby/core/string/upcase_spec.rb6
29 files changed, 137 insertions, 137 deletions
diff --git a/spec/ruby/core/string/capitalize_spec.rb b/spec/ruby/core/string/capitalize_spec.rb
index 376db3aa72..66d3b75f48 100644
--- a/spec/ruby/core/string/capitalize_spec.rb
+++ b/spec/ruby/core/string/capitalize_spec.rb
@@ -196,10 +196,10 @@ describe "String#capitalize!" do
"H".capitalize!.should == nil
end
- it "raises a #{frozen_error_class} when self is frozen" do
+ it "raises a FrozenError when self is frozen" do
["", "Hello", "hello"].each do |a|
a.freeze
- -> { a.capitalize! }.should raise_error(frozen_error_class)
+ -> { a.capitalize! }.should raise_error(FrozenError)
end
end
end
diff --git a/spec/ruby/core/string/chomp_spec.rb b/spec/ruby/core/string/chomp_spec.rb
index a893bf7759..b3f64d7118 100644
--- a/spec/ruby/core/string/chomp_spec.rb
+++ b/spec/ruby/core/string/chomp_spec.rb
@@ -336,19 +336,19 @@ describe "String#chomp!" do
end
end
- it "raises a #{frozen_error_class} on a frozen instance when it is modified" do
+ it "raises a FrozenError on a frozen instance when it is modified" do
a = "string\n\r"
a.freeze
- -> { a.chomp! }.should raise_error(frozen_error_class)
+ -> { a.chomp! }.should raise_error(FrozenError)
end
# see [ruby-core:23666]
- it "raises a #{frozen_error_class} on a frozen instance when it would not be modified" do
+ it "raises a FrozenError on a frozen instance when it would not be modified" do
a = "string\n\r"
a.freeze
- -> { a.chomp!(nil) }.should raise_error(frozen_error_class)
- -> { a.chomp!("x") }.should raise_error(frozen_error_class)
+ -> { a.chomp!(nil) }.should raise_error(FrozenError)
+ -> { a.chomp!("x") }.should raise_error(FrozenError)
end
end
diff --git a/spec/ruby/core/string/chop_spec.rb b/spec/ruby/core/string/chop_spec.rb
index 9e893c3bea..e9cd8f51d2 100644
--- a/spec/ruby/core/string/chop_spec.rb
+++ b/spec/ruby/core/string/chop_spec.rb
@@ -113,14 +113,14 @@ describe "String#chop!" do
"".chop!.should be_nil
end
- it "raises a #{frozen_error_class} on a frozen instance that is modified" do
- -> { "string\n\r".freeze.chop! }.should raise_error(frozen_error_class)
+ it "raises a FrozenError on a frozen instance that is modified" do
+ -> { "string\n\r".freeze.chop! }.should raise_error(FrozenError)
end
# see [ruby-core:23666]
- it "raises a #{frozen_error_class} on a frozen instance that would not be modified" do
+ it "raises a FrozenError on a frozen instance that would not be modified" do
a = ""
a.freeze
- -> { a.chop! }.should raise_error(frozen_error_class)
+ -> { a.chop! }.should raise_error(FrozenError)
end
end
diff --git a/spec/ruby/core/string/clear_spec.rb b/spec/ruby/core/string/clear_spec.rb
index 0b5b8e6998..e1d68e03bd 100644
--- a/spec/ruby/core/string/clear_spec.rb
+++ b/spec/ruby/core/string/clear_spec.rb
@@ -29,9 +29,9 @@ describe "String#clear" do
s.should == ""
end
- it "raises a #{frozen_error_class} if self is frozen" do
+ it "raises a FrozenError if self is frozen" do
@s.freeze
- -> { @s.clear }.should raise_error(frozen_error_class)
- -> { "".freeze.clear }.should raise_error(frozen_error_class)
+ -> { @s.clear }.should raise_error(FrozenError)
+ -> { "".freeze.clear }.should raise_error(FrozenError)
end
end
diff --git a/spec/ruby/core/string/delete_prefix_spec.rb b/spec/ruby/core/string/delete_prefix_spec.rb
index 92c301b44a..3332ca9d08 100644
--- a/spec/ruby/core/string/delete_prefix_spec.rb
+++ b/spec/ruby/core/string/delete_prefix_spec.rb
@@ -74,10 +74,10 @@ ruby_version_is '2.5' do
'hello'.delete_prefix!(o).should == 'o'
end
- it "raises a #{frozen_error_class} when self is frozen" do
- -> { 'hello'.freeze.delete_prefix!('hell') }.should raise_error(frozen_error_class)
- -> { 'hello'.freeze.delete_prefix!('') }.should raise_error(frozen_error_class)
- -> { ''.freeze.delete_prefix!('') }.should raise_error(frozen_error_class)
+ it "raises a FrozenError when self is frozen" do
+ -> { 'hello'.freeze.delete_prefix!('hell') }.should raise_error(FrozenError)
+ -> { 'hello'.freeze.delete_prefix!('') }.should raise_error(FrozenError)
+ -> { ''.freeze.delete_prefix!('') }.should raise_error(FrozenError)
end
end
end
diff --git a/spec/ruby/core/string/delete_spec.rb b/spec/ruby/core/string/delete_spec.rb
index 130228041e..ded63f1719 100644
--- a/spec/ruby/core/string/delete_spec.rb
+++ b/spec/ruby/core/string/delete_spec.rb
@@ -111,11 +111,11 @@ describe "String#delete!" do
a.should == "hello"
end
- it "raises a #{frozen_error_class} when self is frozen" do
+ it "raises a FrozenError when self is frozen" do
a = "hello"
a.freeze
- -> { a.delete!("") }.should raise_error(frozen_error_class)
- -> { a.delete!("aeiou", "^e") }.should raise_error(frozen_error_class)
+ -> { a.delete!("") }.should raise_error(FrozenError)
+ -> { a.delete!("aeiou", "^e") }.should raise_error(FrozenError)
end
end
diff --git a/spec/ruby/core/string/delete_suffix_spec.rb b/spec/ruby/core/string/delete_suffix_spec.rb
index edc0f73158..4bc0549c88 100644
--- a/spec/ruby/core/string/delete_suffix_spec.rb
+++ b/spec/ruby/core/string/delete_suffix_spec.rb
@@ -74,10 +74,10 @@ ruby_version_is '2.5' do
'hello'.delete_suffix!(o).should == 'h'
end
- it "raises a #{frozen_error_class} when self is frozen" do
- -> { 'hello'.freeze.delete_suffix!('ello') }.should raise_error(frozen_error_class)
- -> { 'hello'.freeze.delete_suffix!('') }.should raise_error(frozen_error_class)
- -> { ''.freeze.delete_suffix!('') }.should raise_error(frozen_error_class)
+ it "raises a FrozenError when self is frozen" do
+ -> { 'hello'.freeze.delete_suffix!('ello') }.should raise_error(FrozenError)
+ -> { 'hello'.freeze.delete_suffix!('') }.should raise_error(FrozenError)
+ -> { ''.freeze.delete_suffix!('') }.should raise_error(FrozenError)
end
end
end
diff --git a/spec/ruby/core/string/downcase_spec.rb b/spec/ruby/core/string/downcase_spec.rb
index a78b6de373..32e04e8a2c 100644
--- a/spec/ruby/core/string/downcase_spec.rb
+++ b/spec/ruby/core/string/downcase_spec.rb
@@ -183,9 +183,9 @@ describe "String#downcase!" do
a.should == "hello"
end
- it "raises a #{frozen_error_class} when self is frozen" do
- -> { "HeLlo".freeze.downcase! }.should raise_error(frozen_error_class)
- -> { "hello".freeze.downcase! }.should raise_error(frozen_error_class)
+ it "raises a FrozenError when self is frozen" do
+ -> { "HeLlo".freeze.downcase! }.should raise_error(FrozenError)
+ -> { "hello".freeze.downcase! }.should raise_error(FrozenError)
end
it "sets the result String encoding to the source String encoding" do
diff --git a/spec/ruby/core/string/element_set_spec.rb b/spec/ruby/core/string/element_set_spec.rb
index 608efc23b3..e375b4570e 100644
--- a/spec/ruby/core/string/element_set_spec.rb
+++ b/spec/ruby/core/string/element_set_spec.rb
@@ -52,11 +52,11 @@ describe "String#[]= with Fixnum index" do
str.should == "hello"
end
- it "raises a #{frozen_error_class} when self is frozen" do
+ it "raises a FrozenError when self is frozen" do
a = "hello"
a.freeze
- -> { a[0] = "bam" }.should raise_error(frozen_error_class)
+ -> { a[0] = "bam" }.should raise_error(FrozenError)
end
it "calls to_int on index" do
diff --git a/spec/ruby/core/string/encode_spec.rb b/spec/ruby/core/string/encode_spec.rb
index 1c0c939358..04d9db855a 100644
--- a/spec/ruby/core/string/encode_spec.rb
+++ b/spec/ruby/core/string/encode_spec.rb
@@ -112,13 +112,13 @@ describe "String#encode!" do
it_behaves_like :string_encode, :encode!
- it "raises a #{frozen_error_class} when called on a frozen String" do
- -> { "foo".freeze.encode!("euc-jp") }.should raise_error(frozen_error_class)
+ it "raises a FrozenError when called on a frozen String" do
+ -> { "foo".freeze.encode!("euc-jp") }.should raise_error(FrozenError)
end
# http://redmine.ruby-lang.org/issues/show/1836
- it "raises a #{frozen_error_class} when called on a frozen String when it's a no-op" do
- -> { "foo".freeze.encode!("utf-8") }.should raise_error(frozen_error_class)
+ it "raises a FrozenError when called on a frozen String when it's a no-op" do
+ -> { "foo".freeze.encode!("utf-8") }.should raise_error(FrozenError)
end
describe "when passed no options" do
diff --git a/spec/ruby/core/string/force_encoding_spec.rb b/spec/ruby/core/string/force_encoding_spec.rb
index 56d9b1e9bc..2fe5f79c0f 100644
--- a/spec/ruby/core/string/force_encoding_spec.rb
+++ b/spec/ruby/core/string/force_encoding_spec.rb
@@ -64,8 +64,8 @@ describe "String#force_encoding" do
str.dup.force_encoding('utf-16le').should_not == str.encode('utf-16le')
end
- it "raises a #{frozen_error_class} if self is frozen" do
+ it "raises a FrozenError if self is frozen" do
str = "abcd".freeze
- -> { str.force_encoding(str.encoding) }.should raise_error(frozen_error_class)
+ -> { str.force_encoding(str.encoding) }.should raise_error(FrozenError)
end
end
diff --git a/spec/ruby/core/string/gsub_spec.rb b/spec/ruby/core/string/gsub_spec.rb
index f1d2d5ac06..8193464d48 100644
--- a/spec/ruby/core/string/gsub_spec.rb
+++ b/spec/ruby/core/string/gsub_spec.rb
@@ -613,13 +613,13 @@ describe "String#gsub! with pattern and replacement" do
end
# See [ruby-core:23666]
- it "raises a #{frozen_error_class} when self is frozen" do
+ it "raises a FrozenError when self is frozen" do
s = "hello"
s.freeze
- -> { s.gsub!(/ROAR/, "x") }.should raise_error(frozen_error_class)
- -> { s.gsub!(/e/, "e") }.should raise_error(frozen_error_class)
- -> { s.gsub!(/[aeiou]/, '*') }.should raise_error(frozen_error_class)
+ -> { s.gsub!(/ROAR/, "x") }.should raise_error(FrozenError)
+ -> { s.gsub!(/e/, "e") }.should raise_error(FrozenError)
+ -> { s.gsub!(/[aeiou]/, '*') }.should raise_error(FrozenError)
end
end
@@ -652,13 +652,13 @@ describe "String#gsub! with pattern and block" do
end
# See [ruby-core:23663]
- it "raises a #{frozen_error_class} when self is frozen" do
+ it "raises a FrozenError when self is frozen" do
s = "hello"
s.freeze
- -> { s.gsub!(/ROAR/) { "x" } }.should raise_error(frozen_error_class)
- -> { s.gsub!(/e/) { "e" } }.should raise_error(frozen_error_class)
- -> { s.gsub!(/[aeiou]/) { '*' } }.should raise_error(frozen_error_class)
+ -> { s.gsub!(/ROAR/) { "x" } }.should raise_error(FrozenError)
+ -> { s.gsub!(/e/) { "e" } }.should raise_error(FrozenError)
+ -> { s.gsub!(/[aeiou]/) { '*' } }.should raise_error(FrozenError)
end
it "uses the compatible encoding if they are compatible" do
diff --git a/spec/ruby/core/string/insert_spec.rb b/spec/ruby/core/string/insert_spec.rb
index de7c12423a..b26845419f 100644
--- a/spec/ruby/core/string/insert_spec.rb
+++ b/spec/ruby/core/string/insert_spec.rb
@@ -59,10 +59,10 @@ describe "String#insert with index, other" do
-> { "abcd".insert(-6, mock('x')) }.should raise_error(TypeError)
end
- it "raises a #{frozen_error_class} if self is frozen" do
+ it "raises a FrozenError if self is frozen" do
str = "abcd".freeze
- -> { str.insert(4, '') }.should raise_error(frozen_error_class)
- -> { str.insert(4, 'X') }.should raise_error(frozen_error_class)
+ -> { str.insert(4, '') }.should raise_error(FrozenError)
+ -> { str.insert(4, 'X') }.should raise_error(FrozenError)
end
it "inserts a character into a multibyte encoded string" do
diff --git a/spec/ruby/core/string/lstrip_spec.rb b/spec/ruby/core/string/lstrip_spec.rb
index b1a4e8541f..902d660455 100644
--- a/spec/ruby/core/string/lstrip_spec.rb
+++ b/spec/ruby/core/string/lstrip_spec.rb
@@ -40,13 +40,13 @@ describe "String#lstrip!" do
a.should == "hello"
end
- it "raises a #{frozen_error_class} on a frozen instance that is modified" do
- -> { " hello ".freeze.lstrip! }.should raise_error(frozen_error_class)
+ it "raises a FrozenError on a frozen instance that is modified" do
+ -> { " hello ".freeze.lstrip! }.should raise_error(FrozenError)
end
# see [ruby-core:23657]
- it "raises a #{frozen_error_class} on a frozen instance that would not be modified" do
- -> { "hello".freeze.lstrip! }.should raise_error(frozen_error_class)
- -> { "".freeze.lstrip! }.should raise_error(frozen_error_class)
+ it "raises a FrozenError on a frozen instance that would not be modified" do
+ -> { "hello".freeze.lstrip! }.should raise_error(FrozenError)
+ -> { "".freeze.lstrip! }.should raise_error(FrozenError)
end
end
diff --git a/spec/ruby/core/string/prepend_spec.rb b/spec/ruby/core/string/prepend_spec.rb
index c20c5a9e59..a6074be3c6 100644
--- a/spec/ruby/core/string/prepend_spec.rb
+++ b/spec/ruby/core/string/prepend_spec.rb
@@ -20,12 +20,12 @@ describe "String#prepend" do
-> { 'hello '.prepend mock('x') }.should raise_error(TypeError)
end
- it "raises a #{frozen_error_class} when self is frozen" do
+ it "raises a FrozenError when self is frozen" do
a = "hello"
a.freeze
- -> { a.prepend "" }.should raise_error(frozen_error_class)
- -> { a.prepend "test" }.should raise_error(frozen_error_class)
+ -> { a.prepend "" }.should raise_error(FrozenError)
+ -> { a.prepend "test" }.should raise_error(FrozenError)
end
it "works when given a subclass instance" do
diff --git a/spec/ruby/core/string/reverse_spec.rb b/spec/ruby/core/string/reverse_spec.rb
index eef46063a5..30d5385c83 100644
--- a/spec/ruby/core/string/reverse_spec.rb
+++ b/spec/ruby/core/string/reverse_spec.rb
@@ -32,14 +32,14 @@ describe "String#reverse!" do
"".reverse!.should == ""
end
- it "raises a #{frozen_error_class} on a frozen instance that is modified" do
- -> { "anna".freeze.reverse! }.should raise_error(frozen_error_class)
- -> { "hello".freeze.reverse! }.should raise_error(frozen_error_class)
+ it "raises a FrozenError on a frozen instance that is modified" do
+ -> { "anna".freeze.reverse! }.should raise_error(FrozenError)
+ -> { "hello".freeze.reverse! }.should raise_error(FrozenError)
end
# see [ruby-core:23666]
- it "raises a #{frozen_error_class} on a frozen instance that would not be modified" do
- -> { "".freeze.reverse! }.should raise_error(frozen_error_class)
+ it "raises a FrozenError on a frozen instance that would not be modified" do
+ -> { "".freeze.reverse! }.should raise_error(FrozenError)
end
it "reverses a string with multi byte characters" do
diff --git a/spec/ruby/core/string/rstrip_spec.rb b/spec/ruby/core/string/rstrip_spec.rb
index 9482765e89..0a01ffad73 100644
--- a/spec/ruby/core/string/rstrip_spec.rb
+++ b/spec/ruby/core/string/rstrip_spec.rb
@@ -42,13 +42,13 @@ describe "String#rstrip!" do
a.should == "hello"
end
- it "raises a #{frozen_error_class} on a frozen instance that is modified" do
- -> { " hello ".freeze.rstrip! }.should raise_error(frozen_error_class)
+ it "raises a FrozenError on a frozen instance that is modified" do
+ -> { " hello ".freeze.rstrip! }.should raise_error(FrozenError)
end
# see [ruby-core:23666]
- it "raises a #{frozen_error_class} on a frozen instance that would not be modified" do
- -> { "hello".freeze.rstrip! }.should raise_error(frozen_error_class)
- -> { "".freeze.rstrip! }.should raise_error(frozen_error_class)
+ it "raises a FrozenError on a frozen instance that would not be modified" do
+ -> { "hello".freeze.rstrip! }.should raise_error(FrozenError)
+ -> { "".freeze.rstrip! }.should raise_error(FrozenError)
end
end
diff --git a/spec/ruby/core/string/setbyte_spec.rb b/spec/ruby/core/string/setbyte_spec.rb
index 6912b1b66f..03e5bad88b 100644
--- a/spec/ruby/core/string/setbyte_spec.rb
+++ b/spec/ruby/core/string/setbyte_spec.rb
@@ -75,10 +75,10 @@ describe "String#setbyte" do
str1.should_not == "ledgehog"
end
- it "raises a #{frozen_error_class} if self is frozen" do
+ it "raises a FrozenError if self is frozen" do
str = "cold".freeze
str.frozen?.should be_true
- -> { str.setbyte(3,96) }.should raise_error(frozen_error_class)
+ -> { str.setbyte(3,96) }.should raise_error(FrozenError)
end
it "raises a TypeError unless the second argument is an Integer" do
diff --git a/spec/ruby/core/string/shared/concat.rb b/spec/ruby/core/string/shared/concat.rb
index 435158496e..d127b08e9c 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
-> { 'hello '.send(@method, mock('x')) }.should raise_error(TypeError)
end
- it "raises a #{frozen_error_class} when self is frozen" do
+ it "raises a FrozenError when self is frozen" do
a = "hello"
a.freeze
- -> { a.send(@method, "") }.should raise_error(frozen_error_class)
- -> { a.send(@method, "test") }.should raise_error(frozen_error_class)
+ -> { a.send(@method, "") }.should raise_error(FrozenError)
+ -> { a.send(@method, "test") }.should raise_error(FrozenError)
end
it "returns a String when given a subclass instance" do
@@ -89,12 +89,12 @@ describe :string_concat, shared: true do
-> { "".send(@method, x) }.should raise_error(TypeError)
end
- it "raises a #{frozen_error_class} when self is frozen" do
+ it "raises a FrozenError when self is frozen" do
a = "hello"
a.freeze
- -> { a.send(@method, 0) }.should raise_error(frozen_error_class)
- -> { a.send(@method, 33) }.should raise_error(frozen_error_class)
+ -> { a.send(@method, 0) }.should raise_error(FrozenError)
+ -> { a.send(@method, 33) }.should raise_error(FrozenError)
end
end
end
diff --git a/spec/ruby/core/string/shared/replace.rb b/spec/ruby/core/string/shared/replace.rb
index 620021eb92..3c5a15e12d 100644
--- a/spec/ruby/core/string/shared/replace.rb
+++ b/spec/ruby/core/string/shared/replace.rb
@@ -64,14 +64,14 @@ describe :string_replace, shared: true do
-> { "hello".send(@method, mock('x')) }.should raise_error(TypeError)
end
- it "raises a #{frozen_error_class} on a frozen instance that is modified" do
+ it "raises a FrozenError on a frozen instance that is modified" do
a = "hello".freeze
- -> { a.send(@method, "world") }.should raise_error(frozen_error_class)
+ -> { a.send(@method, "world") }.should raise_error(FrozenError)
end
# see [ruby-core:23666]
- it "raises a #{frozen_error_class} on a frozen instance when self-replacing" do
+ it "raises a FrozenError on a frozen instance when self-replacing" do
a = "hello".freeze
- -> { a.send(@method, a) }.should raise_error(frozen_error_class)
+ -> { a.send(@method, a) }.should raise_error(FrozenError)
end
end
diff --git a/spec/ruby/core/string/shared/succ.rb b/spec/ruby/core/string/shared/succ.rb
index 80e4659102..346ccee409 100644
--- a/spec/ruby/core/string/shared/succ.rb
+++ b/spec/ruby/core/string/shared/succ.rb
@@ -83,8 +83,8 @@ describe :string_succ_bang, shared: true do
end
end
- it "raises a #{frozen_error_class} if self is frozen" do
- -> { "".freeze.send(@method) }.should raise_error(frozen_error_class)
- -> { "abcd".freeze.send(@method) }.should raise_error(frozen_error_class)
+ it "raises a FrozenError if self is frozen" do
+ -> { "".freeze.send(@method) }.should raise_error(FrozenError)
+ -> { "abcd".freeze.send(@method) }.should raise_error(FrozenError)
end
end
diff --git a/spec/ruby/core/string/slice_spec.rb b/spec/ruby/core/string/slice_spec.rb
index f9f4938af3..a34dd1b8d4 100644
--- a/spec/ruby/core/string/slice_spec.rb
+++ b/spec/ruby/core/string/slice_spec.rb
@@ -53,10 +53,10 @@ describe "String#slice! with index" do
a.should == "hello"
end
- it "raises a #{frozen_error_class} if self is frozen" do
- -> { "hello".freeze.slice!(1) }.should raise_error(frozen_error_class)
- -> { "hello".freeze.slice!(10) }.should raise_error(frozen_error_class)
- -> { "".freeze.slice!(0) }.should raise_error(frozen_error_class)
+ it "raises a FrozenError if self is frozen" do
+ -> { "hello".freeze.slice!(1) }.should raise_error(FrozenError)
+ -> { "hello".freeze.slice!(10) }.should raise_error(FrozenError)
+ -> { "".freeze.slice!(0) }.should raise_error(FrozenError)
end
it "calls to_int on index" do
@@ -119,14 +119,14 @@ describe "String#slice! with index, length" do
a.should == "hello"
end
- it "raises a #{frozen_error_class} if self is frozen" do
- -> { "hello".freeze.slice!(1, 2) }.should raise_error(frozen_error_class)
- -> { "hello".freeze.slice!(10, 3) }.should raise_error(frozen_error_class)
- -> { "hello".freeze.slice!(-10, 3)}.should raise_error(frozen_error_class)
- -> { "hello".freeze.slice!(4, -3) }.should raise_error(frozen_error_class)
- -> { "hello".freeze.slice!(10, 3) }.should raise_error(frozen_error_class)
- -> { "hello".freeze.slice!(-10, 3)}.should raise_error(frozen_error_class)
- -> { "hello".freeze.slice!(4, -3) }.should raise_error(frozen_error_class)
+ it "raises a FrozenError if self is frozen" do
+ -> { "hello".freeze.slice!(1, 2) }.should raise_error(FrozenError)
+ -> { "hello".freeze.slice!(10, 3) }.should raise_error(FrozenError)
+ -> { "hello".freeze.slice!(-10, 3)}.should raise_error(FrozenError)
+ -> { "hello".freeze.slice!(4, -3) }.should raise_error(FrozenError)
+ -> { "hello".freeze.slice!(10, 3) }.should raise_error(FrozenError)
+ -> { "hello".freeze.slice!(-10, 3)}.should raise_error(FrozenError)
+ -> { "hello".freeze.slice!(4, -3) }.should raise_error(FrozenError)
end
it "calls to_int on idx and length" do
@@ -248,13 +248,13 @@ describe "String#slice! Range" do
end
- it "raises a #{frozen_error_class} on a frozen instance that is modified" do
- -> { "hello".freeze.slice!(1..3) }.should raise_error(frozen_error_class)
+ it "raises a FrozenError on a frozen instance that is modified" do
+ -> { "hello".freeze.slice!(1..3) }.should raise_error(FrozenError)
end
# see redmine #1551
- it "raises a #{frozen_error_class} on a frozen instance that would not be modified" do
- -> { "hello".freeze.slice!(10..20)}.should raise_error(frozen_error_class)
+ it "raises a FrozenError on a frozen instance that would not be modified" do
+ -> { "hello".freeze.slice!(10..20)}.should raise_error(FrozenError)
end
end
@@ -318,12 +318,12 @@ describe "String#slice! with Regexp" do
$~.should == nil
end
- it "raises a #{frozen_error_class} on a frozen instance that is modified" do
- -> { "this is a string".freeze.slice!(/s.*t/) }.should raise_error(frozen_error_class)
+ it "raises a FrozenError on a frozen instance that is modified" do
+ -> { "this is a string".freeze.slice!(/s.*t/) }.should raise_error(FrozenError)
end
- it "raises a #{frozen_error_class} on a frozen instance that would not be modified" do
- -> { "this is a string".freeze.slice!(/zzz/) }.should raise_error(frozen_error_class)
+ it "raises a FrozenError on a frozen instance that would not be modified" do
+ -> { "this is a string".freeze.slice!(/zzz/) }.should raise_error(FrozenError)
end
end
@@ -410,10 +410,10 @@ describe "String#slice! with Regexp, index" do
$~.should == nil
end
- it "raises a #{frozen_error_class} if self is frozen" do
- -> { "this is a string".freeze.slice!(/s.*t/) }.should raise_error(frozen_error_class)
- -> { "this is a string".freeze.slice!(/zzz/, 0)}.should raise_error(frozen_error_class)
- -> { "this is a string".freeze.slice!(/(.)/, 2)}.should raise_error(frozen_error_class)
+ it "raises a FrozenError if self is frozen" do
+ -> { "this is a string".freeze.slice!(/s.*t/) }.should raise_error(FrozenError)
+ -> { "this is a string".freeze.slice!(/zzz/, 0)}.should raise_error(FrozenError)
+ -> { "this is a string".freeze.slice!(/(.)/, 2)}.should raise_error(FrozenError)
end
end
@@ -468,9 +468,9 @@ describe "String#slice! with String" do
r.should be_an_instance_of(StringSpecs::MyString)
end
- it "raises a #{frozen_error_class} if self is frozen" do
- -> { "hello hello".freeze.slice!('llo') }.should raise_error(frozen_error_class)
- -> { "this is a string".freeze.slice!('zzz')}.should raise_error(frozen_error_class)
- -> { "this is a string".freeze.slice!('zzz')}.should raise_error(frozen_error_class)
+ it "raises a FrozenError if self is frozen" do
+ -> { "hello hello".freeze.slice!('llo') }.should raise_error(FrozenError)
+ -> { "this is a string".freeze.slice!('zzz')}.should raise_error(FrozenError)
+ -> { "this is a string".freeze.slice!('zzz')}.should raise_error(FrozenError)
end
end
diff --git a/spec/ruby/core/string/squeeze_spec.rb b/spec/ruby/core/string/squeeze_spec.rb
index 2e96684b9d..e54ed42b49 100644
--- a/spec/ruby/core/string/squeeze_spec.rb
+++ b/spec/ruby/core/string/squeeze_spec.rb
@@ -105,11 +105,11 @@ describe "String#squeeze!" do
-> { s.squeeze!("^e-b") }.should raise_error(ArgumentError)
end
- it "raises a #{frozen_error_class} when self is frozen" do
+ it "raises a FrozenError when self is frozen" do
a = "yellow moon"
a.freeze
- -> { a.squeeze!("") }.should raise_error(frozen_error_class)
- -> { a.squeeze! }.should raise_error(frozen_error_class)
+ -> { a.squeeze!("") }.should raise_error(FrozenError)
+ -> { a.squeeze! }.should raise_error(FrozenError)
end
end
diff --git a/spec/ruby/core/string/strip_spec.rb b/spec/ruby/core/string/strip_spec.rb
index 728b3104fa..1838e07f32 100644
--- a/spec/ruby/core/string/strip_spec.rb
+++ b/spec/ruby/core/string/strip_spec.rb
@@ -50,13 +50,13 @@ describe "String#strip!" do
a.should == "\x00 goodbye"
end
- it "raises a #{frozen_error_class} on a frozen instance that is modified" do
- -> { " hello ".freeze.strip! }.should raise_error(frozen_error_class)
+ it "raises a FrozenError on a frozen instance that is modified" do
+ -> { " hello ".freeze.strip! }.should raise_error(FrozenError)
end
# see #1552
- it "raises a #{frozen_error_class} on a frozen instance that would not be modified" do
- -> {"hello".freeze.strip! }.should raise_error(frozen_error_class)
- -> {"".freeze.strip! }.should raise_error(frozen_error_class)
+ it "raises a FrozenError on a frozen instance that would not be modified" do
+ -> {"hello".freeze.strip! }.should raise_error(FrozenError)
+ -> {"".freeze.strip! }.should raise_error(FrozenError)
end
end
diff --git a/spec/ruby/core/string/sub_spec.rb b/spec/ruby/core/string/sub_spec.rb
index 2a859c2fc7..f240cd8cff 100644
--- a/spec/ruby/core/string/sub_spec.rb
+++ b/spec/ruby/core/string/sub_spec.rb
@@ -332,13 +332,13 @@ describe "String#sub! with pattern, replacement" do
a.should == "hello"
end
- it "raises a #{frozen_error_class} when self is frozen" do
+ it "raises a FrozenError when self is frozen" do
s = "hello"
s.freeze
- -> { s.sub!(/ROAR/, "x") }.should raise_error(frozen_error_class)
- -> { s.sub!(/e/, "e") }.should raise_error(frozen_error_class)
- -> { s.sub!(/[aeiou]/, '*') }.should raise_error(frozen_error_class)
+ -> { s.sub!(/ROAR/, "x") }.should raise_error(FrozenError)
+ -> { s.sub!(/e/, "e") }.should raise_error(FrozenError)
+ -> { s.sub!(/[aeiou]/, '*') }.should raise_error(FrozenError)
end
end
@@ -387,13 +387,13 @@ describe "String#sub! with pattern and block" do
-> { str.sub!(//) { str << 'x' } }.should raise_error(RuntimeError)
end
- it "raises a #{frozen_error_class} when self is frozen" do
+ it "raises a FrozenError when self is frozen" do
s = "hello"
s.freeze
- -> { s.sub!(/ROAR/) { "x" } }.should raise_error(frozen_error_class)
- -> { s.sub!(/e/) { "e" } }.should raise_error(frozen_error_class)
- -> { s.sub!(/[aeiou]/) { '*' } }.should raise_error(frozen_error_class)
+ -> { s.sub!(/ROAR/) { "x" } }.should raise_error(FrozenError)
+ -> { s.sub!(/e/) { "e" } }.should raise_error(FrozenError)
+ -> { s.sub!(/[aeiou]/) { '*' } }.should raise_error(FrozenError)
end
end
diff --git a/spec/ruby/core/string/swapcase_spec.rb b/spec/ruby/core/string/swapcase_spec.rb
index b5d9b20451..d1e908d71d 100644
--- a/spec/ruby/core/string/swapcase_spec.rb
+++ b/spec/ruby/core/string/swapcase_spec.rb
@@ -182,10 +182,10 @@ describe "String#swapcase!" do
"".swapcase!.should == nil
end
- it "raises a #{frozen_error_class} when self is frozen" do
+ it "raises a FrozenError when self is frozen" do
["", "hello"].each do |a|
a.freeze
- -> { a.swapcase! }.should raise_error(frozen_error_class)
+ -> { a.swapcase! }.should raise_error(FrozenError)
end
end
end
diff --git a/spec/ruby/core/string/tr_s_spec.rb b/spec/ruby/core/string/tr_s_spec.rb
index a05e421e99..e004ab713c 100644
--- a/spec/ruby/core/string/tr_s_spec.rb
+++ b/spec/ruby/core/string/tr_s_spec.rb
@@ -127,10 +127,10 @@ describe "String#tr_s!" do
s.should == "hello"
end
- it "raises a #{frozen_error_class} if self is frozen" do
+ it "raises a FrozenError if self is frozen" do
s = "hello".freeze
- -> { s.tr_s!("el", "ar") }.should raise_error(frozen_error_class)
- -> { s.tr_s!("l", "r") }.should raise_error(frozen_error_class)
- -> { s.tr_s!("", "") }.should raise_error(frozen_error_class)
+ -> { s.tr_s!("el", "ar") }.should raise_error(FrozenError)
+ -> { s.tr_s!("l", "r") }.should raise_error(FrozenError)
+ -> { s.tr_s!("", "") }.should raise_error(FrozenError)
end
end
diff --git a/spec/ruby/core/string/tr_spec.rb b/spec/ruby/core/string/tr_spec.rb
index ae826fd79b..0e4da398d5 100644
--- a/spec/ruby/core/string/tr_spec.rb
+++ b/spec/ruby/core/string/tr_spec.rb
@@ -122,10 +122,10 @@ describe "String#tr!" do
s.should == "hello"
end
- it "raises a #{frozen_error_class} if self is frozen" do
+ it "raises a FrozenError if self is frozen" do
s = "abcdefghijklmnopqR".freeze
- -> { s.tr!("cdefg", "12") }.should raise_error(frozen_error_class)
- -> { s.tr!("R", "S") }.should raise_error(frozen_error_class)
- -> { s.tr!("", "") }.should raise_error(frozen_error_class)
+ -> { s.tr!("cdefg", "12") }.should raise_error(FrozenError)
+ -> { s.tr!("R", "S") }.should raise_error(FrozenError)
+ -> { s.tr!("", "") }.should raise_error(FrozenError)
end
end
diff --git a/spec/ruby/core/string/upcase_spec.rb b/spec/ruby/core/string/upcase_spec.rb
index 4857079a84..c440b1b0aa 100644
--- a/spec/ruby/core/string/upcase_spec.rb
+++ b/spec/ruby/core/string/upcase_spec.rb
@@ -179,8 +179,8 @@ describe "String#upcase!" do
a.should == "HELLO"
end
- it "raises a #{frozen_error_class} when self is frozen" do
- -> { "HeLlo".freeze.upcase! }.should raise_error(frozen_error_class)
- -> { "HELLO".freeze.upcase! }.should raise_error(frozen_error_class)
+ it "raises a FrozenError when self is frozen" do
+ -> { "HeLlo".freeze.upcase! }.should raise_error(FrozenError)
+ -> { "HELLO".freeze.upcase! }.should raise_error(FrozenError)
end
end