2013-12-22 4 views
1

Я написал функцию и определение шага. Однако огурец не определяет определение шага.Огурцы, не определяющие этапы определения

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.

ответ

0

Я нашел ответ. Нам нужно запустить это с уровня вверх в каталоге.

0

Вы должны попробовать и посмотреть первый вариант огуречной помощи с

bundle exec cucumber --help 

-r, --require LIBRARY|DIR  Require files before executing the features. If this 
           option is not specified, all *.rb files that are 
           siblings or below the features will be loaded auto- 
           matically. Automatic loading is disabled when this 
           option is specified, and all loading becomes explicit. 
           Files under directories named "support" are always 
           loaded first. 
           This option can be specified multiple times. 

И тогда вы можете запустить:

bundle exec cucumber features/my_first.feature -r features/ 
Смежные вопросы