0

皆さん、

私は一箇所で立ち往生しています、構文エラーのように見えます、ここに私のキューがあります:

Feature: This is a test feature

         @stagingsearch
         Scenario Outline: Create a search and run it
                   When I create a search for profile "profilesame" for user <user>
                   Then I should see "Results"

        Examples: These are the users
        | user |
        | mol_2_1 |
        | mol_2_2 |

実装ステップを示すエラーが表示されます:

When /^I create a search for profile "([^"]*)" for user mol_(\d+)_(\d+)$/ do |arg1, arg2, arg3|
  pending # express the regexp above with the code you wish you had
end

私が理解していないのは、キュウリが例 mol_2_1 を単一の文字列として解析しない理由です。ここには 2 つの引数しかありませんが、cucumber は混乱しているようで、3 つの引数として受け取ります。

4

1 に答える 1

2

キュウリの提案を正しくする方法ではなく、ステップを実装するために必要な正規表現は何であるかを尋ねていると思いますか?

その仮定が正しければ、必要な手順は次のとおりです。

When /^I create a search for profile "([^"]*)" for user (.*)$/ do |profile, user|
  pending # express the regexp above with the code you wish you had
end
于 2012-05-09T18:28:29.403 に答える