auxesis / cucumber-nagios

Systems testing plugin for Nagios with Cucumber + Webrat + Mechanize + Net::SSH
http://cucumber-nagios.org/
MIT License
257 stars 43 forks source link

cucumber-nagios don't find steps defenintions when run with absolute path to features dir #77

Open melezhik opened 13 years ago

melezhik commented 13 years ago
$ cd /home/melezhik/repos/SandBox/trunk/melezhik/cucumber
$ cucumber-nagios-gen project google.ru
$ cd google.ru
$ bundle install
$ cucumber-nagios-gen feature google.ru bidding
$ cucumber-nagios features/google.ru/bidding.feature --pretty

    Feature: google.ru
      It should be up

      Scenario: Visiting home page      # features/google.ru/bidding.feature:4
        When I go to "http://google.ru" # features/steps/http_steps.rb:11
        Then the request should succeed # features/steps/http_steps.rb:64

    1 scenario (1 passed)
    2 steps (2 passed)
    0m0.432s

when run the same in `absolute' flavour I have :

    $ cd   
    $ cucumber-nagios /home/melezhik/repos/SandBox/trunk/melezhik/cucumber/google.ru/features/google.ru/bidding.feature --pretty --debug

cucumber --format pretty /home/melezhik/repos/SandBox/trunk/melezhik/cucumber/google.ru/features google.ru/bidding.feature

    Feature: google.ru
      It should be up

      Scenario: Visiting home page      # /home/melezhik/repos/SandBox/trunk/melezhik/cucumber/google.ru/features/google.ru/bidding.feature:4
        When I go to "http://google.ru" # /home/melezhik/repos/SandBox/trunk/melezhik/cucumber/google.ru/features/google.ru/bidding.feature:5
        Then the request should succeed # /home/melezhik/repos/SandBox/trunk/melezhik/cucumber/google.ru/features/google.ru/bidding.feature:6

    1 scenario (1 undefined)
    2 steps (2 undefined)
    0m0.002s

    You can implement step definitions for undefined steps with these snippets:

    When /^I go to "([^"]*)"$/ do |arg1|
      pending # express the regexp above with the code you wish you had
    end

    Then /^the request should succeed$/ do
      pending # express the regexp above with the code you wish you had
    end
brianjolly commented 12 years ago

Try requiring the features directory.

This is what worked for me: cucumber --format Cucumber::Formatter::Nagios --require /path/to/features /path/to/features/project/some.feature