1 #! /usr/bin/env ruby -S rspec
2 require 'spec_helper_acceptance'
4 describe 'validate_slength function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
6 it 'validates a single string max' do
8 $one = 'discombobulate'
10 validate_slength($one,$two)
13 apply_manifest(pp, :catch_failures => true)
15 it 'validates multiple string maxes' do
17 $one = ['discombobulate', 'moo']
19 validate_slength($one,$two)
22 apply_manifest(pp, :catch_failures => true)
24 it 'validates min/max of strings in array' do
26 $one = ['discombobulate', 'moo']
29 validate_slength($one,$two,$three)
32 apply_manifest(pp, :catch_failures => true)
34 it 'validates a single string max of incorrect length' do
36 $one = 'discombobulate'
38 validate_slength($one,$two)
41 apply_manifest(pp, :expect_failures => true)
43 it 'validates multiple string maxes of incorrect length' do
45 $one = ['discombobulate', 'moo']
47 validate_slength($one,$two)
50 apply_manifest(pp, :expect_failures => true)
52 it 'validates multiple strings min/maxes of incorrect length' do
54 $one = ['discombobulate', 'moo']
57 validate_slength($one,$two,$three)
60 apply_manifest(pp, :expect_failures => true)
64 it 'handles improper number of arguments'
65 it 'handles improper first argument type'
66 it 'handles non-strings in array of first argument'
67 it 'handles improper second argument type'
68 it 'handles improper third argument type'
69 it 'handles negative ranges'
70 it 'handles improper ranges'