Sha256: 07d61d2630796a4790890e8d38b7e7baaf1878c49ca35eab287ff39b0cbb7937

Contents?: true

Size: 646 Bytes

Versions: 15

Compression:

Stored size: 646 Bytes

Contents

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

module MCollective
  module Validator
    describe "#validate" do
      it "should raise an exception if the given string's length is greater than the given value" do
        expect{
          LengthValidator.validate("test", 3)
        }.to raise_error(ValidatorError, "Input string is longer than 3 character(s)")
      end

      it "should not raise an exception if the given string's length is less than the given value" do
        LengthValidator.validate("test", 4)
      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/length_validator_spec.rb
mcollective-client-2.6.1 spec/unit/plugins/mcollective/validator/length_validator_spec.rb
mcollective-client-2.6.0 spec/unit/plugins/mcollective/validator/length_validator_spec.rb
mcollective-client-2.5.3 spec/unit/plugins/mcollective/validator/length_validator_spec.rb
mcollective-client-2.5.2 spec/unit/plugins/mcollective/validator/length_validator_spec.rb
mcollective-client-2.5.1 spec/unit/plugins/mcollective/validator/length_validator_spec.rb
mcollective-client-2.5.0 spec/unit/plugins/mcollective/validator/length_validator_spec.rb
mcollective-client-2.5.0.rc1 spec/unit/plugins/mcollective/validator/length_validator_spec.rb
mcollective-client-2.4.1 spec/unit/plugins/mcollective/validator/length_validator_spec.rb
mcollective-client-2.4.0 spec/unit/plugins/mcollective/validator/length_validator_spec.rb
mcollective-client-2.2.4 spec/unit/plugins/mcollective/validator/length_validator_spec.rb
mcollective-client-2.2.3 spec/unit/plugins/mcollective/validator/length_validator_spec.rb
mcollective-client-2.2.2 spec/unit/plugins/mcollective/validator/length_validator_spec.rb
mcollective-client-2.2.1 spec/unit/plugins/mcollective/validator/length_validator_spec.rb
mcollective-client-2.2.0 spec/unit/plugins/mcollective/validator/length_validator_spec.rb