We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0f46334 commit ffd0e80Copy full SHA for ffd0e80
spec/regression/JRUBY-6141_matchdata_captures_spec.rb
@@ -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
9
10
+ it "returns first value from Regexp.last_match after all String#scan iterations" do
11
+ @firstmatch.captures[0].should == "first"
12
13
14
+ it "returns last value from Regexp.last_match after all String#scan iterations" do
15
+ @lastmatch.captures[0].should == "last"
16
17
+end
0 commit comments