特拉维斯CI无法解析我的小黄蜂`.feature`文件

时间:2014-01-16 23:44:58

标签: ruby-on-rails rspec cucumber travis-ci gherkin

我正在使用RSpec和Turnip(也是使用Gherkin语法的Cucumber的替代品)来测试我的Rails应用程序。

我的规格和验收测试在我的本地机器上运行100%绿色。

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

但是,当我让Travis CI运行时,Turnip验收测试失败了:

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'

我暂时禁用了它们,现在构建通过了:

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

您是否知道.feature文件导致问题的原因?它们似乎被解析错了,或者它们不被认为是小黄瓜。

感谢您的帮助。

1 个答案:

答案 0 :(得分:1)

我修复了它:问题是我没有将我的.rspec文件签入Git(其中包含必要的-r turnip/rspec行)。