Domanda

I'm using RSpec and Turnip (an alternative to Cucumber that also uses Gherkin syntax) to test my Rails application.

My specs and acceptance tests run 100% green on my local machine.

josh@macbuech:~/Documents/Work/MuheimWebdesign/transition (master *)$ rake
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
/Users/josh/.rvm/rubies/ruby-2.0.0-p353/bin/ruby -S rspec ./spec/acceptance/users/confirm_registration.feature ./spec/acceptance/users/sign_in.feature ./spec/acceptance/users/sign_out.feature ./spec/acceptance/users/sign_up.feature ./spec/acceptance/users/user_edit.feature ./spec/acceptance/users/user_show.feature ./spec/cells/mini_hub_cell_spec.rb ./spec/controllers/dashboards_controller_spec.rb ./spec/models/user_spec.rb ./spec/routing/users_routing_spec.rb
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
 30/30 |======================================================== 100 ========================================================>| Time: 00:00:01 

Finished in 1.89 seconds
30 examples, 0 failures

When I let Travis CI run them, though, the Turnip acceptance tests fail:

https://travis-ci.org/jmuheim/transition/builds/17069121

/home/travis/build/jmuheim/transition/spec/acceptance/users/confirm_registration.feature:1: syntax error, unexpected ':', expecting end-of-input (SyntaxError)
Feature: Confirm registration
        ^
    from /home/travis/build/jmuheim/transition/vendor/bundle/ruby/2.0.0/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in `block in load_spec_files'
    from /home/travis/build/jmuheim/transition/vendor/bundle/ruby/2.0.0/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in `each'
    from /home/travis/build/jmuheim/transition/vendor/bundle/ruby/2.0.0/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in `load_spec_files'
    from /home/travis/build/jmuheim/transition/vendor/bundle/ruby/2.0.0/gems/rspec-core-2.14.7/lib/rspec/core/command_line.rb:22:in `run'
    from /home/travis/build/jmuheim/transition/vendor/bundle/ruby/2.0.0/gems/rspec-core-2.14.7/lib/rspec/core/runner.rb:80:in `run'
    from /home/travis/build/jmuheim/transition/vendor/bundle/ruby/2.0.0/gems/rspec-core-2.14.7/lib/rspec/core/runner.rb:17:in `block in autorun'

I have disabled them temporarily, and now the build passes:

https://travis-ci.org/jmuheim/transition/builds/17074697

Do you have any idea why the .feature files cause problems? They somehow seem to be parsed wrong, or they are not recognized as Gherkin.

Thanks for help.

È stato utile?

Soluzione

I fixed it: the problem was that I didn't have my .rspec file checked into Git (which contains the essential -r turnip/rspec line).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top