test/unit/schemacop/v3/node_test.rb in schemacop-3.0.10 vs test/unit/schemacop/v3/node_test.rb in schemacop-3.0.11
- old
+ new
@@ -91,10 +91,14 @@
assert_validation(nil) do
error '/', 'Value must be given.'
end
+ assert_validation('') do
+ error '/', 'Value must be given.'
+ end
+
assert_validation('5')
assert_validation('5.3') do
error '/', 'Matches 0 definitions but should match exactly 1.'
end
@@ -153,9 +157,15 @@
)
assert_validation(nil)
assert_validation([nil]) do
error '/[0]', 'Value must be given.'
+ end
+ assert_validation(['']) do
+ error '/[0]', 'Value must be given.'
+ end
+ assert_validation([]) do
+ error '/', 'Array has 0 items but must have exactly 1.'
end
end
def test_not_support_block
assert_raises_with_message Schemacop::Exceptions::InvalidSchemaError, 'Node Schemacop::V3::IntegerNode does not support blocks.' do