summaryrefslogtreecommitdiff
path: root/spec/ruby/shared/string
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/shared/string')
-rw-r--r--spec/ruby/shared/string/end_with.rb4
-rw-r--r--spec/ruby/shared/string/times.rb6
2 files changed, 5 insertions, 5 deletions
diff --git a/spec/ruby/shared/string/end_with.rb b/spec/ruby/shared/string/end_with.rb
index 0e4c1386e8..08f43c1bce 100644
--- a/spec/ruby/shared/string/end_with.rb
+++ b/spec/ruby/shared/string/end_with.rb
@@ -55,7 +55,7 @@ describe :end_with, shared: true do
it "checks that we are starting to match at the head of a character" do
"\xC3\xA9".send(@method).should_not.end_with?("\xA9")
"\xe3\x81\x82".send(@method).should_not.end_with?("\x82")
- "ab".force_encoding("UTF-16BE").send(@method).should_not.end_with?(
- "b".force_encoding("UTF-16BE"))
+ "\xd8\x00\xdc\x00".dup.force_encoding("UTF-16BE").send(@method).should_not.end_with?(
+ "\xdc\x00".dup.force_encoding("UTF-16BE"))
end
end
diff --git a/spec/ruby/shared/string/times.rb b/spec/ruby/shared/string/times.rb
index be3b622f73..4814f894cf 100644
--- a/spec/ruby/shared/string/times.rb
+++ b/spec/ruby/shared/string/times.rb
@@ -39,18 +39,18 @@ describe :string_times, shared: true do
end
it "returns a String in the same encoding as self" do
- str = "\xE3\x81\x82".force_encoding Encoding::UTF_8
+ str = "\xE3\x81\x82".dup.force_encoding Encoding::UTF_8
result = @object.call(str, 2)
result.encoding.should equal(Encoding::UTF_8)
end
- platform_is wordsize: 32 do
+ platform_is c_long_size: 32 do
it "raises an ArgumentError if the length of the resulting string doesn't fit into a long" do
-> { @object.call("abc", (2 ** 31) - 1) }.should raise_error(ArgumentError)
end
end
- platform_is wordsize: 64 do
+ platform_is c_long_size: 64 do
it "raises an ArgumentError if the length of the resulting string doesn't fit into a long" do
-> { @object.call("abc", (2 ** 63) - 1) }.should raise_error(ArgumentError)
end