mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@a0b7d0d
This commit is contained in:
parent
a4fbc7e288
commit
22e2a6a999
66 changed files with 943 additions and 167 deletions
|
@ -11,6 +11,19 @@ describe "String#rpartition with String" do
|
|||
"hello".rpartition("hello").should == ["", "hello", ""]
|
||||
end
|
||||
|
||||
it "returns original string if regexp doesn't match" do
|
||||
"hello".rpartition("/x/").should == ["", "", "hello"]
|
||||
end
|
||||
|
||||
it "returns new object if doesn't match" do
|
||||
str = "hello"
|
||||
str.rpartition("/no_match/").last.should_not.equal?(str)
|
||||
end
|
||||
|
||||
it "handles multibyte string correctly" do
|
||||
"ユーザ@ドメイン".rpartition(/@/).should == ["ユーザ", "@", "ドメイン"]
|
||||
end
|
||||
|
||||
it "accepts regexp" do
|
||||
"hello!".rpartition(/l./).should == ["hel", "lo", "!"]
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue