Add minitest support #13

merged 1 commit into from Sep 5, 2011


None yet

2 participants


minitest is a drop-in replacement for test/unit. It's already in 1.9 and Rails is using it when possible.


It propably needs some more work as we might not be able to get rid of test/unit just yet.
valid_attribute test/unit mode basically depends on shoulda, and shoulda (shoulda-context) depends on test/unit

@wojtekmach wojtekmach closed this Aug 26, 2011

I would actually prefer the minitest solution over test/unit. Dropping any Shoulda dependency would be great.

@wojtekmach wojtekmach reopened this Aug 28, 2011

I did a minimal implementation to make this work: It leverages minitest 2.5+ subject and uses upstream valid_attribute. What's your thoughts on this?


Hello, following discussion in seattlerb/minitest#33, I created minitest-matchers gem: I updated the commit to reflect changes.

You can see it in action here:


Can you update the README so I can pull all of this in with one clean commit?


It pretty much works except one feature. In minitest-matchers right now we can't have matcher description with values from subject becasuse we define must_ in context of spec class not spec instance (spec instance has access to subject).
So the last example from README won't pass: wont { have_valid(:title) }

It's a nice feature worth taking look at tho.

@bcardarella bcardarella merged commit eb6cfc2 into bcardarella:master Sep 5, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment