mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@7de852d
This commit is contained in:
parent
994833085a
commit
79671ec57e
135 changed files with 4415 additions and 4885 deletions
|
@ -347,22 +347,20 @@ describe "String#rindex with Regexp" do
|
|||
lambda { "str".rindex(/../, nil) }.should raise_error(TypeError)
|
||||
end
|
||||
|
||||
with_feature :encoding do
|
||||
it "returns the reverse character index of a multibyte character" do
|
||||
"ありがりがとう".rindex("が").should == 4
|
||||
"ありがりがとう".rindex(/が/).should == 4
|
||||
end
|
||||
it "returns the reverse character index of a multibyte character" do
|
||||
"ありがりがとう".rindex("が").should == 4
|
||||
"ありがりがとう".rindex(/が/).should == 4
|
||||
end
|
||||
|
||||
it "returns the character index before the finish" do
|
||||
"ありがりがとう".rindex("が", 3).should == 2
|
||||
"ありがりがとう".rindex(/が/, 3).should == 2
|
||||
end
|
||||
it "returns the character index before the finish" do
|
||||
"ありがりがとう".rindex("が", 3).should == 2
|
||||
"ありがりがとう".rindex(/が/, 3).should == 2
|
||||
end
|
||||
|
||||
it "raises an Encoding::CompatibilityError if the encodings are incompatible" do
|
||||
re = Regexp.new "れ".encode(Encoding::EUC_JP)
|
||||
lambda do
|
||||
"あれ".rindex re
|
||||
end.should raise_error(Encoding::CompatibilityError)
|
||||
end
|
||||
it "raises an Encoding::CompatibilityError if the encodings are incompatible" do
|
||||
re = Regexp.new "れ".encode(Encoding::EUC_JP)
|
||||
lambda do
|
||||
"あれ".rindex re
|
||||
end.should raise_error(Encoding::CompatibilityError)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue