summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/upto_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/string/upto_spec.rb')
-rw-r--r--spec/ruby/core/string/upto_spec.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/ruby/core/string/upto_spec.rb b/spec/ruby/core/string/upto_spec.rb
index 3799e338e0..8bc847d5ac 100644
--- a/spec/ruby/core/string/upto_spec.rb
+++ b/spec/ruby/core/string/upto_spec.rb
@@ -81,8 +81,8 @@ describe "String#upto" do
end
it "raises Encoding::CompatibilityError when incompatible characters are given" do
- char1 = 'a'.force_encoding("EUC-JP")
- char2 = 'b'.force_encoding("ISO-2022-JP")
+ char1 = 'a'.dup.force_encoding("EUC-JP")
+ char2 = 'b'.dup.force_encoding("ISO-2022-JP")
-> { char1.upto(char2) {} }.should raise_error(Encoding::CompatibilityError, "incompatible character encodings: EUC-JP and ISO-2022-JP")
end