Skip to content

Commit ffd0e80

Browse files
jpaceBanzaiMan
authored andcommitted
JRUBY-6141 - added RubySpec test.
Signed-off-by: Hiro Asari <[email protected]>
1 parent 0f46334 commit ffd0e80

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
describe "JRUBY-6141: Matchdata#captures" do
2+
3+
before :all do
4+
"first, last".scan(Regexp.new('(first|last)')) do
5+
@firstmatch ||= Regexp.last_match
6+
end
7+
@lastmatch = Regexp.last_match
8+
end
9+
10+
it "returns first value from Regexp.last_match after all String#scan iterations" do
11+
@firstmatch.captures[0].should == "first"
12+
end
13+
14+
it "returns last value from Regexp.last_match after all String#scan iterations" do
15+
@lastmatch.captures[0].should == "last"
16+
end
17+
end

0 commit comments

Comments
 (0)