Sha256: 7fe45433ead7d7537744739afc5f9492f5229638216d9485324140739d3cf7ac
Contents?: true
Size: 623 Bytes
Versions: 28
Compression:
Stored size: 623 Bytes
Contents
#!/usr/bin/env rspec require 'spec_helper' require 'mcollective/validator/shellsafe_validator' 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
28 entries across 28 versions & 1 rubygems