我有一个我一直在使用 ruby 1.9.1 开发的应用程序。我想在我的 UI 中测试 javascript,而 capybara 的默认 selenium 驱动程序不支持我需要测试的事件。
所以我正在经历使用 rvm 将应用程序切换到 jruby 进行测试的过程,因为显然 celertiy/culerity 目前仅适用于 jruby。我已经安装了我的包,并且该应用程序似乎在 jruby 上正常工作,但是当我尝试运行“rake cucumber”时,我得到以下输出:
Using the default profile...
superclass mismatch for class SQLiteAdapter (TypeError)
/home/david/.rvm/gems/jruby-1.5.3@test2/gems/database_cleaner-0.5.2/lib/database_cleaner/active_record/truncation.rb:11
/home/david/.rvm/gems/jruby-1.5.3@test2/gems/database_cleaner-0.5.2/lib/database_cleaner/active_record/truncation.rb:239:in `require'
/home/david/.rvm/gems/jruby-1.5.3@test2/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
/home/david/.rvm/gems/jruby-1.5.3@test2/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:227:in `load_dependency'
/home/david/.rvm/gems/jruby-1.5.3@test2/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
/home/david/.rvm/gems/jruby-1.5.3@test2/gems/database_cleaner-0.5.2/lib/database_cleaner/configuration.rb:86:in `orm_strategy'
/home/david/.rvm/gems/jruby-1.5.3@test2/gems/database_cleaner-0.5.2/lib/database_cleaner/configuration.rb:42:in `create_strategy'
/home/david/.rvm/gems/jruby-1.5.3@test2/gems/database_cleaner-0.5.2/lib/database_cleaner/configuration.rb:56:in `strategy='
/home/david/rental/features/support/env.rb:58
/home/david/rental/features/support/env.rb:143:in `load'
/home/david/.rvm/gems/jruby-1.5.3@test2/gems/cucumber-0.9.2/bin/../lib/cucumber/rb_support/rb_language.rb:143:in `load_code_file'
/home/david/.rvm/gems/jruby-1.5.3@test2/gems/cucumber-0.9.2/bin/../lib/cucumber/runtime/support_code.rb:158:in `load_file'
/home/david/.rvm/gems/jruby-1.5.3@test2/gems/cucumber-0.9.2/bin/../lib/cucumber/runtime/support_code.rb:61:in `load_files!'
/home/david/.rvm/gems/jruby-1.5.3@test2/gems/cucumber-0.9.2/bin/../lib/cucumber/runtime/support_code.rb:60:in `each'
/home/david/.rvm/gems/jruby-1.5.3@test2/gems/cucumber-0.9.2/bin/../lib/cucumber/runtime/support_code.rb:60:in `load_files!'
/home/david/.rvm/gems/jruby-1.5.3@test2/gems/cucumber-0.9.2/bin/../lib/cucumber/runtime.rb:185:in `load_step_definitions'
/home/david/.rvm/gems/jruby-1.5.3@test2/gems/cucumber-0.9.2/bin/../lib/cucumber/runtime.rb:26:in `run!'
/home/david/.rvm/gems/jruby-1.5.3@test2/gems/cucumber-0.9.2/bin/../lib/cucumber/cli/main.rb:54:in `execute!'
/home/david/.rvm/gems/jruby-1.5.3@test2/gems/cucumber-0.9.2/bin/../lib/cucumber/cli/main.rb:29:in `execute'
/home/david/.rvm/gems/jruby-1.5.3@test2/gems/cucumber-0.9.2/bin/cucumber:8
rake aborted!
Command failed with status (1): [bundle exec /home/david/.rvm/rubies/jruby-...]
有一次,我使用 sqlite 作为我的测试数据库,但后来发生了变化。我什至尝试改回sqlite,但仍然出现相同的错误。如果我在 features/support/env.rb 中禁用 database_cleaner,测试会运行,但它们都会神秘地失败。
有人知道这里发生了什么吗?