Test that correct error is raised.

This commit is contained in:
Gabe Berke-Williams 2012-03-23 10:49:06 -04:00
parent ba78ed0ff8
commit ca6d428760
1 changed files with 8 additions and 0 deletions

View File

@ -87,4 +87,12 @@ describe Shoulda::Matchers::ActiveModel::AllowValueMatcher do
@matcher.description.should eq('allow baz to be set to "foo"')
end
end
context "an AllowValueMatcher with no values" do
it "raises an error" do
lambda do
allow_value.for(:baz)
end.should raise_error(ArgumentError, /at least one argument/)
end
end
end