Skip to content

Commit

Permalink
JRUBY-6141 - added RubySpec test.
Browse files Browse the repository at this point in the history
Signed-off-by: Hiro Asari <asari.ruby@gmail.com>
  • Loading branch information
jpace authored and BanzaiMan committed Oct 23, 2011
1 parent 7f478fc commit a2f8fd0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions spec/regression/JRUBY-6141_matchdata_captures_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
describe "JRUBY-6141: Matchdata#captures" do

before :all do
"first, last".scan(Regexp.new('(first|last)')) do
@firstmatch ||= Regexp.last_match
end
@lastmatch = Regexp.last_match
end

it "returns first value from Regexp.last_match after all String#scan iterations" do
@firstmatch.captures[0].should == "first"
end

it "returns last value from Regexp.last_match after all String#scan iterations" do
@lastmatch.captures[0].should == "last"
end
end

0 comments on commit a2f8fd0

Please sign in to comment.