Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run kaminari specs

Tags:

ruby

kaminari

this is probably a stupid question but I can't seem to find the answer.

I'd like to contribute to kaminari, so I forked the repo, bundle'd it, and now I would like to run the specs to ensure all's green. But I can't seem to make it work :

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

I tried to bypass bundler, but then I got gems issues with versions and stuff. So what am I missing here ? I don't find anything on the wiki or the issues, or even here about this.

Thanks for your time!

like image 480
ksol Avatar asked Jan 17 '23 11:01

ksol


1 Answers

I recently made series of changes on Kaminari tests. https://github.com/amatsuda/kaminari/compare/b61db76...1f8389ae

As a result of this big refactoring, now the tests can be run separately per each ORM library, for example like this:

BUNDLE_GEMFILE=gemfiles/active_record_32.gemfile bundle exec rake spec

To run all tests at once, you should invoke spec:all task:

bundle exec rake spec:all

I'm aware that this is a bit unusual. At least it apparently needs to be documented. I'll do so till the next stable release.

Or if you have any better solution, please tell me.

like image 52
Akira Matsuda Avatar answered Jan 25 '23 15:01

Akira Matsuda