0
這是我的測試,但即使@timeout_exception在代碼運行期間工作,在測試過程中它是空的。那麼如何測試這個變量是否被設置?@變量在Gherkins /黃瓜測試中爲空
Then(/^the output should be '(.*)'$/) do |expectedException|
expect(@timeout_exception).to eq(expectedException)
end
這是bundle exec cucumber run的輸出。
And the output should be 'Execution Timeout Error: This deployment has taken too long to run' # features/step_definitions/my_steps.rb:309
expected: "Execution Timeout Error: This deployment has taken too long to run"
got: nil
(compared using ==)
(RSpec::Expectations::ExpectationNotMetError)
./features/step_definitions/my_steps.rb:310:in `/^the output should be '(.*)'$/'
features/timeout_lengthy_deploys.feature:25:in `And the output should be 'Execution Timeout Error: This deployment has taken too long to run''
Failing Scenarios:
cucumber features/timeout_lengthy_deploys.feature:11 # Scenario: Normal deploy that times out because it takes too long