mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
15 lines
400 B
Ruby
15 lines
400 B
Ruby
|
require File.expand_path('../../../spec_helper', __FILE__)
|
||
|
|
||
|
describe "MatchData#string" do
|
||
|
it "returns a copy of the match string" do
|
||
|
str = /(.)(.)(\d+)(\d)/.match("THX1138.").string
|
||
|
str.should == "THX1138."
|
||
|
end
|
||
|
|
||
|
it "returns a frozen copy of the match string" do
|
||
|
str = /(.)(.)(\d+)(\d)/.match("THX1138.").string
|
||
|
str.should == "THX1138."
|
||
|
str.frozen?.should == true
|
||
|
end
|
||
|
end
|