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

RSpec errors when using spring #23

Open
esambo opened this issue Nov 12, 2021 · 0 comments
Open

RSpec errors when using spring #23

esambo opened this issue Nov 12, 2021 · 0 comments

Comments

@esambo
Copy link
Contributor

esambo commented Nov 12, 2021

Problem

ℹ️ FYI, I get RSpec errors when using spring because the custom testing/rspec RSpec matchers aren't loaded.

Errors

NameError:
       undefined local variable or method `act_as_enumerated'

and

expected #<...> to respond to `has_enumerated?`

Fix

My workaround is to add the the following to my rails config/environments/test.rb file:

  config.to_prepare do
    require_dependency "testing/rspec"
  end

Context

This is inspired by rails/spring#505 (comment)

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

1 participant