mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@28a728b
This commit is contained in:
parent
3eb0d50c0b
commit
664e96b1de
42 changed files with 484 additions and 117 deletions
|
@ -10,4 +10,9 @@ describe "MatchData#regexp" do
|
|||
m = 'haystack'.match(/hay/)
|
||||
m.regexp.should == /hay/
|
||||
end
|
||||
|
||||
it "returns a Regexp for the result of gsub(String)" do
|
||||
'he[[o'.gsub('[', ']')
|
||||
$~.regexp.should == /\[/
|
||||
end
|
||||
end
|
||||
|
|
|
@ -11,4 +11,15 @@ describe "MatchData#string" do
|
|||
str.should == "THX1138."
|
||||
str.frozen?.should == true
|
||||
end
|
||||
|
||||
it "returns the same frozen string for every call" do
|
||||
md = /(.)(.)(\d+)(\d)/.match("THX1138.")
|
||||
md.string.should equal(md.string)
|
||||
end
|
||||
|
||||
it "returns a frozen copy of the matched string for gsub(String)" do
|
||||
'he[[o'.gsub!('[', ']')
|
||||
$~.string.should == 'he[[o'
|
||||
$~.string.frozen?.should == true
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue