thoughtbot / shoulda-matchers

Simple one-liner tests for common Rails functionality
https://matchers.shoulda.io
MIT License
3.51k stars 912 forks source link

Uninitialized Constant Rspec #1408

Closed Merovex closed 3 years ago

Merovex commented 3 years ago

I am only using minitest, not Rspec. However, I get the following error message:

/shoulda-matchers-4.5.0/lib/shoulda/matchers/integrations/test_frameworks/rspec.rb:13:in include': uninitialized constant RSpec (NameError)

Given there are instructions for using Minitest, is there a way to solve this without resorting to adding Rspec?

Merovex commented 3 years ago

Solved my own problem. The README says to add the following to the bottom of the test_helper.rb:

Shoulda::Matchers.configure do |config|
  config.integrate do |with|
    with.test_framework :rspec
    with.library :rails
  end
end

But it should be

Shoulda::Matchers.configure do |config|
  config.integrate do |with|
    with.test_framework :minitest
    with.library :rails
  end
end
mcmire commented 3 years ago

Did you see the Minitest section? :) https://github.com/thoughtbot/shoulda-matchers#minitest