我已經寫了一個特徵和一個步驟的定義。但是,黃瓜不能識別步驟定義。黃瓜不識別步驟定義
my_first.feature
Feature:
As an iOS developer
I want to have a sample feature file
So I can see what my next step is in the wonderful world of Frank/Cucumber testing
Scenario:
Launching the app
Given I launch the app
步驟定義文件是step_definitions文件夾,命名爲launch_steps.rb。該代碼是:
def app_path
ENV['APP_BUNDLE_PATH'] || (defined?(APP_BUNDLE_PATH) && APP_BUNDLE_PATH)
end
Given /^I launch the app$/ do
launch_app app_path
end
然而,當我運行終端黃瓜,我沒有得到正確的輸出。以下是從終端登錄
features git:(frank) ✗ cucumber my_first.feature
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin13/rbconfig.rb:212: warning: Insecure world writable dir /usr/local in PATH, mode 040777
Feature:
As an iOS developer
I want to have a sample feature file
So I can see what my next step is in the wonderful world of Frank/Cucumber testing
Scenario: # my_first.feature:6
Launching the app
Given I launch the app # my_first.feature:9
1 scenario (1 undefined)
1 step (1 undefined)
0m0.001s
You can implement step definitions for undefined steps with these snippets:
Given(/^I launch the app$/) do
pending # express the regexp above with the code you wish you had
end
If you want snippets in a different programming language,
just make sure a file with the appropriate file extension
exists where cucumber looks for step definitions.
我想學習黃瓜和作爲第一個功能,我試圖啓動應用程序。因此,我的期望是應用程序將啓動此功能。
PS:我還沒有從XCode執行應用程序。