本「The Cucumber Book」の電卓プロジェクトでステップ 2 を実行しようとしています。このフォームで提供された以前の回答に従って、一重引用符の代わりにバックトリックを使用しようとしましたが、以下の同じエラーメッセージが引き続き表示されます。
.F-
(::) failed steps (::)
undefined method `success?' for nil:NilClass (NoMethodError)
./features/step_definitions/calculator_steps.rb:7:in `/^the calculator is run$/'
features/adding.feature:5:in `When the calculator is run'
Failing Scenarios:
cucumber features/adding.feature:3 # Scenario: Add two numbers
1 scenario (1 failed)
3 steps (1 failed, 1 skipped, 1 passed)
0m0.002s
これは、以前にフォーラムで見つけた正確な手順情報です。
Given /^the input "([^"]*)"$/ do |input|
@input = input
end
When /^the calculator is run$/ do
@output = `ruby calc.rb #{@input}`
raise('Command failed!') unless $?.success?
end
Then /^the output should be "([^"]*)"$/ do |arg1|
pending # express the regexp above with the code you wish you had
end
私は何が間違っている可能性がありますか?