gpt4 book ai didi

ruby - 运行 kaminari 规范

转载 作者:数据小太阳 更新时间:2023-10-29 07:25:05 25 4
gpt4 key购买 nike

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

我想为 kaminari 做贡献,所以我 fork 了 repo,bundle 了它,现在我想运行规范以确保一切都是绿色的。但我似乎无法让它发挥作用:

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

我试图绕过 bundler ,但后来我遇到了版本和其他东西的 gem 问题。那我在这里错过了什么?我在 wiki 或问题上找不到任何内容,甚至在这里也找不到。

感谢您的宝贵时间!

最佳答案

我最近对 ​​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

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

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

关于ruby - 运行 kaminari 规范,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10937805/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com