G5 / jsonapi-resources-matchers

Test matchers for jsonapi-resources
MIT License
31 stars 14 forks source link

error loading gem on rake db:migrate test #5

Closed senid231 closed 7 years ago

senid231 commented 8 years ago

$ rake db:migrate RAILS_ENV=test

rake aborted!
Bundler::GemRequireError: There was an error while trying to load the gem 'jsonapi-resources-matchers'.
Gem Load Error is: undefined method `configure' for RSpec:Module
Backtrace for gem load error is:
/home/senid/.rvm/gems/ruby-2.1.8@my_app/gems/jsonapi-resources-matchers-0.4.0/lib/jsonapi/resources/matchers/integrations/rspec.rb:2:in `<top (required)>'
/home/senid/.rvm/gems/ruby-2.1.8@my_app/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
/home/senid/.rvm/gems/ruby-2.1.8@my_app/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require'
/home/senid/.rvm/gems/ruby-2.1.8@my_app/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/home/senid/.rvm/gems/ruby-2.1.8@my_app/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
/home/senid/.rvm/gems/ruby-2.1.8@my_app/gems/jsonapi-resources-matchers-0.4.0/lib/jsonapi/resources/matchers.rb:40:in `<top (required)>'
/home/senid/.rvm/gems/ruby-2.1.8@my_app/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
/home/senid/.rvm/gems/ruby-2.1.8@my_app/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require'
/home/senid/.rvm/gems/ruby-2.1.8@my_app/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/home/senid/.rvm/gems/ruby-2.1.8@my_app/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
/home/senid/.rvm/gems/ruby-2.1.8@my_app/gems/jsonapi-resources-matchers-0.4.0/lib/jsonapi-resources-matchers.rb:1:in `<top (required)>'
/home/senid/.rvm/gems/ruby-2.1.8@my_app/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `require'
/home/senid/.rvm/gems/ruby-2.1.8@my_app/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `block (2 levels) in require'
/home/senid/.rvm/gems/ruby-2.1.8@my_app/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `each'
/home/senid/.rvm/gems/ruby-2.1.8@my_app/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `block in require'
/home/senid/.rvm/gems/ruby-2.1.8@my_app/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `each'
/home/senid/.rvm/gems/ruby-2.1.8@my_app/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `require'
/home/senid/.rvm/gems/ruby-2.1.8@my_app/gems/bundler-1.12.5/lib/bundler.rb:102:in `require'
/home/senid/projects/my_app/config/application.rb:16:in `<top (required)>'

config/application.rb (line 16)

Bundler.require(*Rails.groups)

Gemfile

# ...
group :test do
  gem 'simplecov', require: true
  gem 'connection_pool'
  gem 'factory_girl_rails'
  gem 'capybara'
  gem 'spork', '~> 1.0rc'
  gem 'webmock'
  gem 'rspec-rails', '~> 3.3'
  gem 'database_cleaner', '~> 1.3.0'  #, git: 'https://github.com/bmabey/database_cleaner.git'
  gem 'shoulda-matchers',  '< 3.0'
  # issue on linux (poltergeist version 1.10.0)
  # https://github.com/ariya/phantomjs/issues/14061
  gem 'poltergeist'
  gem 'phantomjs', require: 'phantomjs/poltergeist'
  gem 'selenium-webdriver'
  gem 'chromedriver-helper'
  gem 'capybara-screenshot'
  #gem 'fork_break'
  gem 'jsonapi-resources-matchers'
end
# ...
senid231 commented 8 years ago

changing Gemfile with

gem 'jsonapi-resources-matchers', require: false

and adding to spec_helper.rb/rails_helper.rb

require 'jsonapi-resources-matchers'

resolves the issue

i think you should add information about it to README or something

ramontayag commented 7 years ago

Thanks I'll take a look