Skip to content

Conversation

@jasonkarns
Copy link
Contributor

The Rails.logger double (via as_null_object) is leaking across tests. It is pulled from ::Rails and set as ::Graphiti.logger which, as a constant, persists across specs.

This resets Graphiti's config after the railtie specs which stub on it.

Also, the railtie test can't run without configuring rspec (via some helpers) and loading the Railtie under test. Ideally we'd use a slimmed-down spec_helper for configuring just rspec (without rails). However, that doesn't already exist, and we'd need some form of autoloading anyway; so for the time being we just use the existing rails_helper.

jasonkarns and others added 3 commits March 12, 2023 12:52
If spec_helper existed, we could have a smaller rspec configuration that
did not depend on rails. However, without it, we would need the spec to
load the unit under test as well as rspec and its configuration. It
seems the pattern is to load rails_helper in all specs in order to
configure rspec while also getting rails' autoloading.
@jkeen jkeen merged commit b38faf2 into graphiti-api:master Mar 18, 2025
1 check passed
github-actions bot pushed a commit that referenced this pull request Mar 21, 2025
## [0.4.1](v0.4.0...v0.4.1) (2025-03-21)

### Bug Fixes

* `register_parameter_parser` overiding custom config ([#109](#109)) ([a135bfa](a135bfa))
* Add basic column type conversion. ([#83](#83)) ([e5bbc92](e5bbc92))
* Add condition to check RSpec availability in install generator ([#63](#63)) ([13895d9](13895d9))
* rspec double was leaking across tests ([#105](#105)) ([b38faf2](b38faf2))
* Stringify path if Rails version > 7 ([#107](#107)) ([47d356c](47d356c))
@github-actions
Copy link

🎉 This PR is included in version 0.4.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants