最近、page-object gem を入手しましたが、この gem が含まれていると (Cucumber/Selenium に基づく) テストを実行できませんでした。
gem リストによると、gem がインストールされています。
page-object (0.9.1)
私のenv.rbファイルには以下が含まれます:
require 'page-object'
ただし、テストを実行しようとすると、次のエラーが表示されます。
/Library/Ruby/Gems/1.8/gems/page-object-0.9.1/lib/page-object/widgets.rb:32: 構文エラー、予期しない「=」、「|」が必要です ...dget_tag do |name, identifier={:index => 0}, &block| ^ /Library/Ruby/Gems/1.8/gems/page-object-0.9.1/lib/page-object/widgets.rb:32: 構文エラー、予期しない ','、kEND を期待しています ...ame、identifier={ :index => 0}, &block| ^ /Library/Ruby/Gems/1.8/gems/page-object-0.9.1/lib/page-object/widgets.rb:122: 構文エラー、予期しない kEND、$end が必要 (SyntaxError) /Library/Ruby/Site /1.8/rubygems/core_ext/kernel_require.rb:51:require
gem_original_require' /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:51:in
' /ライブラリ/Ruby/Gems/1.8/gems/page-object-0.9.1/lib/page-object.rb:10 />ライブラリ/Ruby/サイト/1.8/rubygems/core_ext/kernel_require.rb:116:ingem_original_require' />Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:116:in
require' /Users/garethbragg/dev/trade-finder/test/cucumber/features/support/env.rb:6 /Library/Ruby/Gems/1.8/gems/cucumber-1.3.5/bin/../lib/ cucumber/rb_support/rb_language.rb:122:inload' /Library/Ruby/Gems/1.8/gems/cucumber-1.3.5/bin/../lib/cucumber/rb_support/rb_language.rb:122:in
load_code_file'load_file' /Library/Ruby/Gems/1.8/gems/cucumber-1.3.5/bin/../lib/cucumber/runtime/support_code.rb:83:in
/Library/Ruby/Gems/1.8/gems/cucumber-1.3.5/bin/../lib/cucumber/runtime/support_code.rb:180:load_files! ' /Library/Ruby/Gems/1.8/gems/cucumber-1.3.5/bin/../lib/cucumber/runtime/support_code.rb:82:ineach' /Library/Ruby/Gems/1.8/gems/cucumber-1.3.5/bin/../lib/cucumber/runtime/support_code.rb:82:in
load_files!' /Library/Ruby/Gems/1.8/gems/cucumber-1.3.5/bin/../lib/cucumber/runtime.rb:183load_step_definitions' /Library/Ruby/Gems/1.8/gems/cucumber-1.3.5/bin/../lib/cucumber/runtime.rb:42:in
:実行中!' /Library/Ruby/Gems/1.8/gems/cucumber-1.3.5/bin/../lib/cucumber/cli/main.rb:47:inexecute!' /Library/Ruby/Gems/1.8/gems/cucumber-1.3.5/bin/cucumber:13 /usr/bin/cucumber:23:in
load' /usr/bin/cucumber:23
クラスのいずれかに PageObject を含めると、次のようになります。
初期化されていない定数 Home::PageObject (NameError) ./lib/Home.rb:4 /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:51:require
gem_original_require' /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:51:in
' /Users/garethbragg/dev/trade-finder /test/cucumber/features/support/env.rb:2 /Library/Ruby/Gems/1.8/gems/cucumber-1.3.5/bin/../lib/cucumber/rb_support/rb_language.rb:122:inload' /Library/Ruby/Gems/1.8/gems/cucumber-1.3.5/bin/../lib/cucumber/rb_support/rb_language.rb:122:in
load_code_file 'load_file' /Library/Ruby/Gems/1.8/gems/cucumber-1.3.5/bin/../lib/cucumber/runtime/support_code.rb:83:in
/Library/Ruby/Gems/1.8/gems/cucumber-1.3.5/bin/../lib/cucumber/runtime/support_code.rb:180:in load_files!' /Library/Ruby/Gems/1.8/gems/cucumber-1.3.5/bin/../lib/cucumber/runtime/support_code.rb:82:ineach' /Library/Ruby/Gems/1.8/gems/cucumber-1.3.5/bin/../lib/cucumber/runtime/support_code.rb:82:in
load_files!' /Library/Ruby/Gems/1.8/gems/cucumber-1.3.5/bin/../lib/cucumber/runtime.rb:183load_step_definitions' /Library/Ruby/Gems/1.8/gems/cucumber-1.3.5/bin/../lib/cucumber/runtime.rb:42:in
:実行中!' /Library/Ruby/Gems/1.8/gems/cucumber-1.3.5/bin/../lib/cucumber/cli/main.rb:47:inexecute!' /Library/Ruby/Gems/1.8/gems/cucumber-1.3.5/bin/cucumber:13 /usr/bin/cucumber:23:in
load' /usr/bin/cucumber:23
任意の提案をいただければ幸いです。