Sha256: 5a97296702b8a619e58b64e2d9a1f9fdecf029811391e810e1376ee6ccc49a8c
Contents?: true
Size: 675 Bytes
Versions: 15
Compression:
Stored size: 675 Bytes
Contents
#!/usr/bin/env rspec require 'spec_helper' require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/validator/shellsafe_validator.rb' module MCollective module Validator describe "#validate" do it "should raise an exception if the given string is not shellsafe" do ['`', '$', ';', '|', '&&', '>', '<'].each do |chr| expect{ ShellsafeValidator.validate("#{chr}test") }.to raise_error(ValidatorError, "value should not have #{chr} in it") end end it "should not raise an exception if the given string is shellsafe" do ShellsafeValidator.validate("test") end end end end
Version data entries
15 entries across 15 versions & 1 rubygems