summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/partition_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/string/partition_spec.rb')
-rw-r--r--spec/ruby/core/string/partition_spec.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/ruby/core/string/partition_spec.rb b/spec/ruby/core/string/partition_spec.rb
index 9cb3672881..29fe910b39 100644
--- a/spec/ruby/core/string/partition_spec.rb
+++ b/spec/ruby/core/string/partition_spec.rb
@@ -31,8 +31,8 @@ describe "String#partition with String" do
end
it "raises an error if not convertible to string" do
- ->{ "hello".partition(5) }.should raise_error(TypeError)
- ->{ "hello".partition(nil) }.should raise_error(TypeError)
+ ->{ "hello".partition(5) }.should.raise(TypeError)
+ ->{ "hello".partition(nil) }.should.raise(TypeError)
end
it "takes precedence over a given block" do
@@ -40,7 +40,7 @@ describe "String#partition with String" do
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.partition("é")
@@ -51,7 +51,7 @@ describe "String#partition 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".partition(pattern)