1 #! /usr/bin/env ruby -S rspec
2 require 'spec_helper_acceptance'
4 describe 'validate_cmd function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
6 it 'validates a true command' do
9 if $::osfamily == 'windows' {
10 $two = 'echo' #shell built-in
14 validate_cmd($one,$two)
17 apply_manifest(pp, :catch_failures => true)
19 it 'validates a fail command' do
22 if $::osfamily == 'windows' {
27 validate_cmd($one,$two)
30 apply_manifest(pp, :expect_failures => true)
32 it 'validates a fail command with a custom error message' do
35 if $::osfamily == 'windows' {
40 validate_cmd($one,$two,"aoeu is dvorak")
43 apply_manifest(pp, :expect_failures => true) do |output|
44 expect(output.stderr).to match(/aoeu is dvorak/)
49 it 'handles improper number of arguments'
50 it 'handles improper argument types'