Sha256: c12cc9610e60c83ee231043c57364566450e137585d31dde8a01f6e12b82123c

Contents?: true

Size: 696 Bytes

Versions: 15

Compression:

Stored size: 696 Bytes

Contents

#!/usr/bin/env rspec
require 'spec_helper'
require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/validator/array_validator.rb'

module MCollective
  module Validator
    describe "#validate" do
      it "should raise an exception if a given element is not defined in a given array" do
        expect{
          Validator::ArrayValidator.validate("element1",["element0", "element2"])
        }.to raise_error(ValidatorError, "value should be one of element0, element2")
      end

      it "should not raise an exception if a given element is defined in a given array" do
        Validator::ArrayValidator.validate("element1", ["element1", "element2"])
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
mcollective-client-2.7.0 spec/unit/plugins/mcollective/validator/array_validator_spec.rb
mcollective-client-2.6.1 spec/unit/plugins/mcollective/validator/array_validator_spec.rb
mcollective-client-2.6.0 spec/unit/plugins/mcollective/validator/array_validator_spec.rb
mcollective-client-2.5.3 spec/unit/plugins/mcollective/validator/array_validator_spec.rb
mcollective-client-2.5.2 spec/unit/plugins/mcollective/validator/array_validator_spec.rb
mcollective-client-2.5.1 spec/unit/plugins/mcollective/validator/array_validator_spec.rb
mcollective-client-2.5.0 spec/unit/plugins/mcollective/validator/array_validator_spec.rb
mcollective-client-2.5.0.rc1 spec/unit/plugins/mcollective/validator/array_validator_spec.rb
mcollective-client-2.4.1 spec/unit/plugins/mcollective/validator/array_validator_spec.rb
mcollective-client-2.4.0 spec/unit/plugins/mcollective/validator/array_validator_spec.rb
mcollective-client-2.2.4 spec/unit/plugins/mcollective/validator/array_validator_spec.rb
mcollective-client-2.2.3 spec/unit/plugins/mcollective/validator/array_validator_spec.rb
mcollective-client-2.2.2 spec/unit/plugins/mcollective/validator/array_validator_spec.rb
mcollective-client-2.2.1 spec/unit/plugins/mcollective/validator/array_validator_spec.rb
mcollective-client-2.2.0 spec/unit/plugins/mcollective/validator/array_validator_spec.rb