Navigation Menu

Skip to content

Commit

Permalink
Add test for validation of catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Feb 12, 2014
1 parent 020cd20 commit 8b7de7c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/unit/catalog/test_version1.rb
Expand Up @@ -174,4 +174,24 @@ def total_weight(dataset)
end
end
end

class ValidationTest < self
data(
:missing_effective_date => {
:catalog => {},
:error => Droonga::Catalog::MissingRequiredParameter
},
:invalid_effective_date => {
:catalog => {
"effective_date" => "invalid",
},
:error => Droonga::Catalog::MissingRequiredParameter
},
)
def test_validation(data)
assert_raise(data[:error]) do
create_catalog(data[:catalog], "path/to/catalog")
end
end
end
end

0 comments on commit 8b7de7c

Please sign in to comment.