bcardarella / valid_attribute

Minimalist validation BDD for ActiveModel specs
178 stars 18 forks source link

TestUnit support #3

Closed bcardarella closed 13 years ago

bcardarella commented 13 years ago

I want something like this:

class UserTest < TestUnit::TestCase
   should have_valid(:name).when('Brian')
   should_not have_valid(:name).when(nil, '')
end

Shoulda has the should and should_not methods but I don't to require Shoulda, so I'll need to write my own class level methods that do the same. But if Shoulda is there it should play nice and not overwrite.