Sha256: 6d93a51f3f2efebba54a38305b4b7c5b153533ae60d436e500d7d330199a1761
Contents?: true
Size: 887 Bytes
Versions: 15
Compression:
Stored size: 887 Bytes
Contents
#!/usr/bin/env rspec require 'spec_helper' require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/validator/typecheck_validator.rb' module MCollective module Validator describe "#validate" do it "should raise an exception if the given value is not of the supplied type" do [[1, String], ['test', :integer], ['test', :float], ['test', :number], [1, :string], ['test', :boolean]].each do |val| expect{ TypecheckValidator.validate(*val) }.to raise_error(ValidatorError, "value should be a #{val[1].to_s}") end end it "should not raise an exception if the given value is of the supplied type" do [["test", String], [1, :integer], [1.2, :float], [1, :number], ["test", :string], [true, :boolean]].each do |val| TypecheckValidator.validate(*val) end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems