bcardarella / valid_attribute

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

Cannot get it to work with Minitest #17

Closed grimen closed 12 years ago

grimen commented 12 years ago

I'm following the example for using valid_attribute with minitest from the README like so:

describe "Validations" do
  subject { Factory.build(:product_tag) }

  it { subject.must have_valid(:x).when(0) }
end

and

describe "Validations" do
  subject { Factory.build(:product_tag) }

  must { have_valid(:x).when(1) }
end

But both yields error:

NoMethodError: undefined method `have_valid' for #<#<Class:0x007fe14bf5ad00>:0x007fe1498f5638>

Tried it successfully with Minitest lately?

bcardarella commented 12 years ago

I'm guessing you're running into the 1.1 Minitest update issue. This was resolved in: https://github.com/bcardarella/valid_attribute/commit/cf96d8b1544ed068a97d694c3124ac86ea37f398

I have not released an updated version of the gem yet.

Please try pulling from master and if this issue continues I'll reopen.

grimen commented 12 years ago

OK I see, thanks for the hint!