-
-
Notifications
You must be signed in to change notification settings - Fork 910
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
Dependence issue with shoulda-matchers 3 and should 3.5 #825
Comments
Yes, shoulda needs to be updated to support shoulda-matchers 3.x. I'll submit a PR over there. Thanks for reminding. |
I'm delaying this until we get all of the 3.0.0 regressions under control. |
In the meantime, I've updated the README to suggest that shoulda users use shoulda-matchers 2.8.0. |
Is it possible, in the meantime, to use shoulda-matchers and minitest without shoulda-context (which provides the 'should' keyword?)? For example, calling them in some fashion in a regular test? |
@gamov I've tried a bunch of things but all failed so I gave up and now waiting for the release (not sure what's holding on though). |
Sorry to keep you waiting. I've created thoughtbot/shoulda#261 to address this. |
Any news on this? It would be nice to use pure minitest with shoulda matchers. |
@gamov @olimart @samuelpismel Gemfile: group :test do
gem 'shoulda-matchers'
gem 'minitest-matchers_vaccine'
end test_helper.rb: Shoulda::Matchers.configure do |config|
config.integrate do |with|
with.test_framework :minitest
with.library :rails
end
end user_test.rb: class UserTest < Minitest::Test
def test_validation
user = User.new
assert_must validate_presence_of(:email), user
end
end or using class UserTest < Minitest::Test
def setup
@subject = User.new
end
def test_validation
must validate_presence_of :email
end
end |
I have created a wiki page to help others with this problem: https://github.com/thoughtbot/shoulda-matchers/wiki/Usage-with-standard-MiniTest-tests |
Thanks @zavan |
That is really great! I'm guessing that you can use this gem alongside |
@mcmire I haven't tried it, but I think so. The gem is super simple: |
Following installation instructions and since I'm using Minitest I've added both shoulda and shoulda-matchers to Gemfile.
The text was updated successfully, but these errors were encountered: