Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add testcase for Regexp#match and $~
  • Loading branch information
Evan Phoenix committed Jan 1, 2010
1 parent a8390a9 commit 4a62bfb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/ruby/core/regexp/match_spec.rb
Expand Up @@ -26,4 +26,13 @@
it "returns a MatchData object" do
(/(.)(.)(.)/.match "abc").class.should == MatchData
end

it "resets $~ if passed nil" do
# set $~
/./.match("a")
$~.should be_kind_of(MatchData)

/1/.match(nil)
$~.should be_nil
end
end

0 comments on commit 4a62bfb

Please sign in to comment.