Add minitest support #13

Merged
merged 1 commit into from Sep 5, 2011

Projects

None yet

2 participants

@wojtekmach
Contributor

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

Contributor

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
Owner

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

@wojtekmach wojtekmach reopened this Aug 28, 2011
Contributor

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

Contributor

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

You can see it in action here: https://gist.github.com/1192809

Owner

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

Contributor

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