4

这可能是一个愚蠢的问题,但我似乎找不到答案。

我想为kaminari做出贡献,所以我分叉了 repo,bundle'd 它,现在我想运行规范以确保一切都是绿色的。但我似乎无法让它工作:

bin/rake spec                                                                                                                                                        

/Users/Ksoltysiak/.rbenv/versions/1.9.3-p125/bin/ruby -S rspec spec/config/config_spec.rb spec/helpers/action_view_extension_spec.rb spec/helpers/helpers_spec.rb spec/helpers/sinatra_helpers_spec.rb spec/helpers/tags_spec.rb spec/models/active_record/active_record_relation_methods_spec.rb spec/models/active_record/default_per_page_spec.rb spec/models/active_record/scopes_spec.rb spec/models/array_spec.rb spec/models/data_mapper/data_mapper_spec.rb spec/models/mongo_mapper/mongo_mapper_spec.rb spec/models/mongoid/mongoid_spec.rb spec/requests/users_spec.rb
warning: no framework detected.
would you check out if your Gemfile appropriately configured?
---- e.g. ----
when Rails:
    gem 'kaminari'

when Sinatra/Padrino:
    gem 'kaminari', :require => 'kaminari/sinatra'

when Grape:
    gem 'kaminari', :require => 'kaminari/grape'

/Users/Ksoltysiak/Documents/Repositories/kaminari/spec/models/array_spec.rb:3:in `<top (required)>': uninitialized constant Kaminari::PaginatableArray (NameError)
    from /Users/Ksoltysiak/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `load'
    from /Users/Ksoltysiak/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `block in load_spec_files'
    from /Users/Ksoltysiak/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `map'
    from /Users/Ksoltysiak/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `load_spec_files'
    from /Users/Ksoltysiak/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.10.1/lib/rspec/core/command_line.rb:22:in `run'
    from /Users/Ksoltysiak/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.10.1/lib/rspec/core/runner.rb:69:in `run'
    from /Users/Ksoltysiak/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.10.1/lib/rspec/core/runner.rb:10:in `block in autorun'
rake aborted!
/Users/Ksoltysiak/.rbenv/versions/1.9.3-p125/bin/ruby -S rspec spec/config/config_spec.rb spec/helpers/action_view_extension_spec.rb spec/helpers/helpers_spec.rb spec/helpers/sinatra_helpers_spec.rb spec/helpers/tags_spec.rb spec/models/active_record/active_record_relation_methods_spec.rb spec/models/active_record/default_per_page_spec.rb spec/models/active_record/scopes_spec.rb spec/models/array_spec.rb spec/models/data_mapper/data_mapper_spec.rb spec/models/mongo_mapper/mongo_mapper_spec.rb spec/models/mongoid/mongoid_spec.rb spec/requests/users_spec.rb failed

我试图绕过捆绑器,但后来我遇到了版本和东西的宝石问题。那么我在这里缺少什么?我没有在 wiki 或问题上找到任何东西,甚至在这里也没有找到任何关于此的内容。

谢谢你的时间!

4

1 回答 1

9

我最近对 ​​Kaminari 测试进行了一系列更改。https://github.com/amatsuda/kaminari/compare/b61db76...1f8389ae

由于这个大重构,现在可以每个 ORM 库单独运行测试,例如:

BUNDLE_GEMFILE=gemfiles/active_record_32.gemfile bundle exec rake spec

要一次运行所有测试,您应该调用spec:all任务:

bundle exec rake spec:all

我知道这有点不寻常。至少它显然需要记录在案。我会这样做,直到下一个稳定版本。

或者如果您有更好的解决方案,请告诉我。

于 2012-06-08T15:35:15.540 回答