X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Funit%2Fplugins%2Fmcollective%2Fvalidator%2Fipv6address_validator_spec.rb;fp=spec%2Funit%2Fplugins%2Fmcollective%2Fvalidator%2Fipv6address_validator_spec.rb;h=a6a2b781a49727e7f9559022fb22e6f6cf98c837;hb=b87d2f4e68281062df1913440ca5753ae63314a9;hp=0000000000000000000000000000000000000000;hpb=ab0ea530b8ac956091f17b104ab2311336cfc250;p=packages%2Fprecise%2Fmcollective.git diff --git a/spec/unit/plugins/mcollective/validator/ipv6address_validator_spec.rb b/spec/unit/plugins/mcollective/validator/ipv6address_validator_spec.rb new file mode 100644 index 0000000..a6a2b78 --- /dev/null +++ b/spec/unit/plugins/mcollective/validator/ipv6address_validator_spec.rb @@ -0,0 +1,19 @@ +#!/usr/bin/env rspec +require 'spec_helper' +require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/validator/ipv6address_validator.rb' + +module MCollective + module Validator + describe "#validate" do + it "should raise an exception if the supplied value is not an ipv6 address" do + expect{ + Ipv6addressValidator.validate("foobar") + }.to raise_error(ValidatorError, "value should be an ipv6 address") + end + + it "should not raise an exception if the supplied value is an ipv6 address" do + Ipv6addressValidator.validate("2001:db8:85a3:8d3:1319:8a2e:370:7348") + end + end + end +end