summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/rpartition_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/string/rpartition_spec.rb')
-rw-r--r--spec/ruby/core/string/rpartition_spec.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/ruby/core/string/rpartition_spec.rb b/spec/ruby/core/string/rpartition_spec.rb
index 21e87f530a..a7dd7430b7 100644
--- a/spec/ruby/core/string/rpartition_spec.rb
+++ b/spec/ruby/core/string/rpartition_spec.rb
@@ -43,12 +43,12 @@ describe "String#rpartition with String" do
end
it "raises an error if not convertible to string" do
- ->{ "hello".rpartition(5) }.should raise_error(TypeError)
- ->{ "hello".rpartition(nil) }.should raise_error(TypeError)
+ ->{ "hello".rpartition(5) }.should.raise(TypeError)
+ ->{ "hello".rpartition(nil) }.should.raise(TypeError)
end
it "handles a pattern in a superset encoding" do
- string = "hello".force_encoding(Encoding::US_ASCII)
+ string = "hello".dup.force_encoding(Encoding::US_ASCII)
result = string.rpartition("é")
@@ -59,7 +59,7 @@ describe "String#rpartition with String" do
end
it "handles a pattern in a subset encoding" do
- pattern = "o".force_encoding(Encoding::US_ASCII)
+ pattern = "o".dup.force_encoding(Encoding::US_ASCII)
result = "héllo world".rpartition(pattern)