jnicklas/turnip

Running Rspec works, but runningthe direct .feature file does not

Closed this issue · 8 comments

If I run all of my specs, via: bundle exec rspec - all my specs run along with the feature defined with turnip ( WOOT! )

However, if I just run the feature file directly, via: spec/features/turnip/user_signs_up.feature, I get this error:

Pending: (Failures listed here are expected and do not affect your suite's status)

  1) User Signing Up Signing up via email When I visit the registration page -> And I click on Register with Email -> Then I should be taken to the new registrations page
     # No such step: 'I visit the registration page'
     # ./spec/features/turnip/user_signs_up.feature:3


Finished in 0.00076 seconds (files took 0.13439 seconds to load)
1 example, 0 failures, 1 pending

Not sure what I'm missing - but many thanks for any help given!
(( And for this legit gem! ))

Hi @thewatts

Please tell me the version of Ruby, RSpec and Turnip.

Hey @gongo!

Thanks for the quick response :)

Ruby 2.2.2
RSpec 3.2.0
Turnip 1.3.0

Thanks!

Hmm, this issue not reproduce in my environment.
Please try example project https://bitbucket.org/gongoZ/turnip-example

$ git clone https://bitbucket.org/gongoZ/turnip-example.git
$ cd turnip-example
$ bundle install --path vendor/bundle

$  ruby --version
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14

$  bundle show | grep rspec
  * rspec (3.2.0)
  * rspec-core (3.2.3)
  * rspec-expectations (3.2.1)
  * rspec-mocks (3.2.1)
  * rspec-support (3.2.2)

$ bundle exec rspec
$ bundle exec rspec spec/features/simple_feature.feature

hey @gongo -->

This definitely works in the example you provided.
However - when I pull that same simple_feature.feature file into my project (along with its steps) -

I still get this:

Pending: (Failures listed here are expected and do not affect your suite's status)

  1) A simple feature This is a simple feature Given there is a monster -> When I attack it -> Then it should die
     # No such step: 'there is a monster'
     # ./spec/features/turnip/simple_feature.feature:3


Finished in 0.00063 seconds (files took 0.11347 seconds to load)
1 example, 0 failures, 1 pending

It looks like, when I just run the .feature file itself - it's not loading up the steps file.

GOT IT!

I was putting the steps import, Dir.glob("spec/features/steps/**/*steps.rb") { |f| load f, true }, in the rails_helper.rb instead of spec_helper.rb

Thanks for your help, @gongo !

Congrats! 🍕