0

gem 開発ガイドに従って、ファイルの内容を確認している部分まで来ました。ポンドと複数行があるため、チェックする内容を\#andでエスケープしています\n

  Scenario: Recipes                                  # features/generator.feature:6
    When I run `foodie recipe dinner steak`          # aruba-0.5.3/lib/aruba/cucumber.rb:60
    Then the following files should exist:           # aruba-0.5.3/lib/aruba/cucumber.rb:256
      | dinner/steak.txt |
    Then the file "dinner/steak.txt" should contain: # aruba-0.5.3/lib/aruba/cucumber.rb:300
      """
      ##### Ingredients #####
      Ingredients for delicious steak go here.


      ##### Instructions #####
      Tips on how to make delicious steak go here.
      """
      expected: /\#\#\#\#\#\ Ingredients\ \#\#\#\#\#\nIngredients\ for\ delicious\ steak\ go\ here\.\n\n\n\#\#\#\#\#\ Instructions\ \#\#\#\#\#\nTips\ on\ how\ to\ make\ delicious\ steak\ go\ here\./
           got: "#### Ingredients ####\nIngredients for delicious steak go here.\n\n\n#### Indtructions ####\nTips on how to make delicious steak go here.\n" (using =~)
      Diff:
      @@ -1,2 +1,7 @@
      -/\#\#\#\#\#\ Ingredients\ \#\#\#\#\#\nIngredients\ for\ delicious\ steak\ go\ here\.\n\n\n\#\#\#\#\#\ Instructions\ \#\#\#\#\#\nTips\ on\ how\ to\ make\ delicious\ steak\ go\ here\./
      +#### Ingredients ####
      +Ingredients for delicious steak go here.
      +
      +
      +#### Indtructions ####
      +Tips on how to make delicious steak go here.
       (RSpec::Expectations::ExpectationNotMetError)
      features/generator.feature:10:in `Then the file "dinner/steak.txt" should contain:'

Failing Scenarios:
cucumber features/generator.feature:6 # Scenario: Recipes

3 scenarios (1 failed, 2 passed)
7 steps (1 failed, 6 passed)
0m0.950s

私が間違っていることはありますか、それともこのガイドは古く、エスケープされたテキストに対してファイルがチェックされないようにするために他に何かする必要がありますか?

アップデート:

ファイルとテストを 1 行に変更し、ポンド記号を削除すると、テストに合格します。

  Scenario: Recipes                                  # features/generator.feature:6
    When I run `foodie recipe dinner steak`          # aruba-0.5.3/lib/aruba/cucumber.rb:60
    Then the following files should exist:           # aruba-0.5.3/lib/aruba/cucumber.rb:256
      | dinner/steak.txt |
    Then the file "dinner/steak.txt" should contain: # aruba-0.5.3/lib/aruba/cucumber.rb:300
      """
      Ingredients: Delicious steak ingredients go here.
      """
4

1 に答える 1