Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.0.5 configure for jsonapi_indifferent_hash breaking rake spec #20

Closed
sa73917 opened this issue Jul 9, 2020 · 4 comments
Closed

v0.0.5 configure for jsonapi_indifferent_hash breaking rake spec #20

sa73917 opened this issue Jul 9, 2020 · 4 comments

Comments

@sa73917
Copy link
Contributor

sa73917 commented Jul 9, 2020

Expected Behavior

jsonapi-rspec gem should load within rake without issues

Actual Behavior

rake aborted!
NoMethodError: undefined method `configure' for RSpec:Module
.../config/application.rb:20:in `<top (required)>'
.../Rakefile:4:in `require_relative'
.../Rakefile:4:in `<top (required)>'

Caused by:
LoadError: cannot load such file -- jsonapi-rspec
.../config/application.rb:20:in `<top (required)>'
.../Rakefile:4:in `require_relative'
.../Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)

Steps to Reproduce the Problem

  1. include v0.0.5 in project Gemfile
  2. run rake spec

Specifications

  • Version: v0.0.5
  • Ruby version: 2.7.1
  • Rake version: 13.0.1

Possible solution

requiring rspec/core in rspec.rb resolves the issue. Not sure if this is the best solution but certainly a simple fix.

@stas
Copy link
Collaborator

stas commented Jul 9, 2020

Hmm, could it be because of this:
https://github.com/jsonapi-rb/jsonapi-rspec/blob/master/lib/jsonapi/rspec.rb#L11-L13

Could you please open a PR please.

@sa73917
Copy link
Contributor Author

sa73917 commented Jul 10, 2020

Yes its definitely those lines of code - it's just rake is being a bit eager trying to load the gem before the RSpec:Core module is there...

Not sure if there's a better way but this PR resolves the issue

@stas
Copy link
Collaborator

stas commented Jul 12, 2020

Fixed in #21

@stas stas closed this as completed Jul 12, 2020
@stas
Copy link
Collaborator

stas commented Jul 12, 2020

Thank you @sa73917!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants