3 require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/validator/array_validator.rb'
7 describe "#validate" do
8 it "should raise an exception if a given element is not defined in a given array" do
10 Validator::ArrayValidator.validate("element1",["element0", "element2"])
11 }.to raise_error(ValidatorError, "value should be one of element0, element2")
14 it "should not raise an exception if a given element is defined in a given array" do
15 Validator::ArrayValidator.validate("element1", ["element1", "element2"])