<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -10,6 +10,9 @@ Using this release on a Rails project requires a rerun of script/generate cucumb
 * Added back a way to globally turn off transactions.
 * Renamed @allow_rescue tag to @allow-rescue.
 
+=== Bugfixes
+* Gracefully handle cases when optional regexp groups are not matched. Ex: /should( not)? be flashed '([^']*?)'$/ (Aslak Helles&#248;y)
+
 == 2009-09-22
 
 This release has some changes in the Rails support, so make sure you run &quot;script/generate cucumber&quot; after you upgrade.</diff>
      <filename>History.txt</filename>
    </modified>
    <modified>
      <diff>@@ -2,11 +2,11 @@
 
 Gem::Specification.new do |s|
   s.name = %q{cucumber}
-  s.version = &quot;0.3.102.1&quot;
+  s.version = &quot;0.3.102.2&quot;
 
   s.required_rubygems_version = Gem::Requirement.new(&quot;&gt;= 0&quot;) if s.respond_to? :required_rubygems_version=
   s.authors = [&quot;Aslak Helles\303\270y&quot;]
-  s.date = %q{2009-09-23}
+  s.date = %q{2009-09-24}
   s.default_executable = %q{cucumber}
   s.description = %q{Executable Feature scenarios}
   s.email = [&quot;aslak.hellesoy@gmail.com&quot;]</diff>
      <filename>cucumber.gemspec</filename>
    </modified>
    <modified>
      <diff>@@ -9,7 +9,8 @@ module Cucumber
           n = 0
           match.captures.map do |val|
             n += 1
-            StepArgument.new(val, match.offset(n)[0])
+            start = match.offset(n)[0]
+            StepArgument.new(val, start)
           end
         else
           nil</diff>
      <filename>lib/cucumber/rb_support/regexp_argument_matcher.rb</filename>
    </modified>
    <modified>
      <diff>@@ -55,6 +55,7 @@ module Cucumber
       s = string.dup
       offset = 0
       step_arguments.each do |step_argument|
+        next if step_argument.pos.nil?
         replacement = if block_given?
           proc.call(step_argument.val)
         elsif Proc === format</diff>
      <filename>lib/cucumber/step_match.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ module Cucumber #:nodoc:
     MAJOR = 0
     MINOR = 3
     TINY  = 102
-    PATCH = 1 # Set to nil for official release
+    PATCH = 2 # Set to nil for official release
 
     STRING = [MAJOR, MINOR, TINY, PATCH].compact.join('.')
   end</diff>
      <filename>lib/cucumber/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,6 +8,11 @@ module Cucumber
         arguments = RegexpArgumentMatcher.arguments_from(/I (\w+) (\w+)/, &quot;I like fish&quot;)
         arguments.map{|argument| [argument.val, argument.pos]}.should == [[&quot;like&quot;, 2], [&quot;fish&quot;, 7]]
       end
+
+      it &quot;should create 2 arguments when first group is optional&quot; do
+        arguments = RegexpArgumentMatcher.arguments_from(/should( not)? be flashed '([^']*?)'$/, &quot;I should be flashed 'Login failed.'&quot;)
+        arguments.map{|argument| [argument.val, argument.pos]}.should == [[nil, nil], [&quot;Login failed.&quot;, 21]]
+      end
     end
   end
 end</diff>
      <filename>spec/cucumber/rb_support/regexp_argument_matcher_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -31,5 +31,10 @@ module Cucumber
       m = stepdef(/I (\w+) (\d+) (\w+) this (\w+)/).step_match(&quot;I ate 1 egg this morning&quot;, nil)
       m.format_args(lambda{|m| &quot;&lt;span&gt;#{m}&lt;/span&gt;&quot;}).should == &quot;I &lt;span&gt;ate&lt;/span&gt; &lt;span&gt;1&lt;/span&gt; &lt;span&gt;egg&lt;/span&gt; this &lt;span&gt;morning&lt;/span&gt;&quot;
     end
+
+    it &quot;should format groups even when first group is optional and not matched&quot; do
+      m = stepdef(/should( not)? be flashed '([^']*?)'$/).step_match(&quot;I should be flashed 'Login failed.'&quot;, nil)
+      m.format_args(&quot;&lt;span&gt;%s&lt;/span&gt;&quot;).should == &quot;I should be flashed '&lt;span&gt;Login failed.&lt;/span&gt;'&quot;
+    end
   end
 end
\ No newline at end of file</diff>
      <filename>spec/cucumber/step_match_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>479670956d9b1ec878793c9c76d44ec43a670e78</id>
    </parent>
  </parents>
  <author>
    <name>Aslak Helles&#248;y</name>
    <email>aslak.hellesoy@gmail.com</email>
  </author>
  <url>http://github.com/aslakhellesoy/cucumber/commit/a6370585c43efd43fa26332d05cca9e57e49bd48</url>
  <id>a6370585c43efd43fa26332d05cca9e57e49bd48</id>
  <committed-date>2009-09-23T15:42:45-07:00</committed-date>
  <authored-date>2009-09-23T15:42:45-07:00</authored-date>
  <message>Release 0.3.102.2</message>
  <tree>920696325b60fb990dcddf4cded928efe2920874</tree>
  <committer>
    <name>Aslak Helles&#248;y</name>
    <email>aslak.hellesoy@gmail.com</email>
  </committer>
</commit>
