mysql 集成测试_在使用mysql的Jruby on Rails应用程序上运行Cucumber/capybara/celerity集成测试...

桂鑫鹏
2023-12-01

因此,我将使用rvm将应用程序切换到jruby进行测试,因为显然celerity/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,测试就会运行,但它们都会神秘地失败。

有人知道这是怎么回事吗?

 类似资料: