Commits

David Krentzlin committed 017a92c

implemented passing steps with arguments

Comments (0)

Files changed (3)

           (let ((submatches (convert-submatches (cdr matches))))
             (if (null? submatches)
                 (cons `#(("id" . ,(number->string id)) ("args") ("regexp" . ,(step-regex-string step)) ("source" . ,(step-source step))) result)
-                (cons `#(("id" . ,(number->string id)) ("args" ,submatches) ("regexp" . ,(step-regex-string step)) ("source" . ,(step-source step))) result)))
+                (cons `#(("id" . ,(number->string id)) ("args" ,@submatches) ("regexp" . ,(step-regex-string step)) ("source" . ,(step-source step))) result)))
           result)))
   (succeed
    (fold step-selector '() step-definitions)))

features/wire_protocol.feature

   #
   # See the specs for Cucumber::WireSupport::WireException for more details
   #
-  @david @wip
+  @david 
   Scenario: Invoke a step definition which fails
     Given a file named "features/step_definitions/failing_step.scm" with:
     """
   #   * pos : the position within the step name that the argument was matched
   #           (used for formatter highlighting)
   #
+  @david
   Scenario: Invoke a step definition which takes string arguments (and passes)
+    Given a file named "features/step_definitions/pass_with_arg.scm" with:
+    """
+    (Given #/we're all (.*)/ (arg1)
+      (equal? arg1 "wired"))
+    """
+    And there is a wire server running on port 54321 with stepfiles "features/step_definitions/pass_with_arg.scm"
     When I run cucumber -f progress
     Then STDERR should be empty
     And it should pass with
           (test-wire-message
            "matching step with captures"
            '("step_matches" #(("name_to_match" . "teststep with capture")))
-           '("success" (#(("id" . "2") ("args" (#(("val" . "capture") ("pos" . 14)))) ("regexp" . "teststep with (.*?)") ("source" . "chicken_steps.scm")))))))
+           '("success" (#(("id" . "2") ("args" #(("val" . "capture") ("pos" . 14))) ("regexp" . "teststep with (.*?)") ("source" . "chicken_steps.scm")))))))
 
      (test-group "snippets"
          (test-group "generate-step-suggestion"