valid_attribute 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY +3 -0
- data/lib/valid_attribute/matcher.rb +1 -1
- data/lib/valid_attribute/version.rb +1 -1
- data/spec/valid_attribute_spec.rb +5 -5
- metadata +1 -1
data/HISTORY
CHANGED
@@ -31,7 +31,7 @@ describe 'ValidAttribute' do
|
|
31
31
|
describe 'messages' do
|
32
32
|
it '#negative_failue_message' do
|
33
33
|
@matcher.matches?(@user)
|
34
|
-
@matcher.negative_failure_message.should == " expected User#name to not accept the values:
|
34
|
+
@matcher.negative_failure_message.should == " expected User#name to not accept the values: \"abc\", 123"
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
@@ -40,7 +40,7 @@ describe 'ValidAttribute' do
|
|
40
40
|
before do
|
41
41
|
@user.stubs(:valid?).returns(false)
|
42
42
|
@user.stubs(:errors).returns({:name => []})
|
43
|
-
@matcher = @should.have_valid(:name).when(
|
43
|
+
@matcher = @should.have_valid(:name).when(:abc, nil)
|
44
44
|
end
|
45
45
|
|
46
46
|
it 'matches? returns false' do
|
@@ -54,7 +54,7 @@ describe 'ValidAttribute' do
|
|
54
54
|
describe 'messages' do
|
55
55
|
it '#failue_message' do
|
56
56
|
@matcher.matches?(@user)
|
57
|
-
@matcher.failure_message.should == " expected User#name to accept the values:
|
57
|
+
@matcher.failure_message.should == " expected User#name to accept the values: :abc, nil"
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
@@ -82,11 +82,11 @@ describe 'ValidAttribute' do
|
|
82
82
|
|
83
83
|
it '#negative_failure_message' do
|
84
84
|
@matcher.matches?(@user)
|
85
|
-
@matcher.negative_failure_message.should == " expected User#name to not accept the value:
|
85
|
+
@matcher.negative_failure_message.should == " expected User#name to not accept the value: \"abc\""
|
86
86
|
end
|
87
87
|
|
88
88
|
it '#description' do
|
89
|
-
@matcher.description.should == "be valid when:
|
89
|
+
@matcher.description.should == "be valid when: \"abc\", 123"
|
90
90
|
end
|
91
91
|
end
|
92
92
|
end
|