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

require rspec-core as a dependency of the matchers #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jasonkarns
Copy link

The rspec matchers depend on rspec-core already being loaded (or being autoloaded).

However, apps that leverage Bundlers require: option for specifying the entrypoint file to be loaded by Bundle.require will not necessarily have autoloading configured at that point (if ever). This ensures that should the rspec.rb file be loaded prior to rspec, it will properly require rspec/core so that the RSpec references actually work.

And the end result is that users don't need to explicitly require 'graphiti_spec_helpers' in a spec-helper at all, but may instead simply adjust their Gemfile:

group :test do
    gem "graphiti_spec_helpers", require: "graphiti_spec_helpers/rspec"
end

fixes #18

The rspec matchers depend on rspec-core already being loaded (or being autoloaded).

However, apps that leverage Bundlers `require:` option for specifying the entrypoint file to be loaded by Bundle.require will not necessarily have autoloading configured at that point (if ever). This ensures that should the rspec.rb file be loaded prior to rspec, it will properly require rspec/core so that the RSpec references actually work.

And the end result is that users don't need to explicitly `require 'graphiti_spec_helpers'` in a spec-helper at all, but may instead simply adjust their Gemfile:
```
group :test do
    gem "graphiti_spec_helpers", require: "graphiti_spec_helpers/rspec"
end
```

fixes graphiti-api#18
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

Successfully merging this pull request may close these issues.

`gem "graphiti_spec_helpers", require: "graphiti_spec_helpers/rspec” doesn't have rspec loaded
1 participant