2017-04-10 50 views
-2

我跟着Reuse Cucumber steps黃瓜高級步驟定義 - 語法錯誤,意外tIDENTIFIER,期待keyword_end

對於Ruby和黃瓜,我是一個小菜。
我使用的葫蘆 - 安卓0.9.0和2.4.0黃瓜

我calabash_steps.rb:

require 'calabash-android/calabash_steps' 

Then /^I add the 1st bestsellers product to bag$/ do 
    steps %Q { 
     # App restarts and Onboarding screen shows again 
     Given I see the text "next" 
     Then I press the "next" button 
    } 
end 

完整堆棧跟蹤:

❯ bundle exec calabash-android run app/build/outputs/apk/app-staging-debug.apk -t @bag 
/Users/eric/AndroidStudioProjects/xxx/features/step_definitions/calabash_steps.rb:7: syntax error, unexpected tIDENTIFIER, expecting keyword_end 
Then I press the "next" button 
          ^(SyntaxError) 
/Users/eric/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/lib/cucumber/rb_support/rb_language.rb:96:in `load' 
/Users/eric/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/lib/cucumber/rb_support/rb_language.rb:96:in `load_code_file' 
/Users/eric/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/lib/cucumber/runtime/support_code.rb:142:in `load_file' 
/Users/eric/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/lib/cucumber/runtime/support_code.rb:84:in `block in load_files!' 
/Users/eric/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/lib/cucumber/runtime/support_code.rb:83:in `each' 
/Users/eric/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/lib/cucumber/runtime/support_code.rb:83:in `load_files!' 
/Users/eric/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/lib/cucumber/runtime.rb:253:in `load_step_definitions' 
/Users/eric/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/lib/cucumber/runtime.rb:61:in `run!' 
/Users/eric/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/lib/cucumber/cli/main.rb:32:in `execute!' 
/Users/eric/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/bin/cucumber:8:in `<top (required)>' 
/Users/eric/.rbenv/versions/2.4.0/bin/cucumber:22:in `load' 
/Users/eric/.rbenv/versions/2.4.0/bin/cucumber:22:in `<main>' 
+0

一些討厭的人保持downvoting我的問題沒有留下評論?我願意做任何事情來改善我的問題,請成爲StackOverflow的負責用戶 – ericn

回答

0

的問題是多餘的空間steps %Q {,將其更改爲steps %Q{使問題消失
我有濫用空間字符以提高Java和Javascript可讀性的習慣

需要 '葫蘆-的Android/calabash_steps'

Then /^I add the 1st bestsellers product to bag$/ do 
    steps %Q{ 
     # App restarts and Onboarding screen shows again 
     Given I see the text "next" 
     Then I press the "next" button 
    } 
end 
相關問題