91
90
expect { provider.run("cd ..") }.to raise_error(ArgumentError, "Could not find command 'cd'")
98
Puppet::Util::Execution.expects(:execute).with(anything(), has_entry(:uid, nil)).returns(Puppet::Util::Execution::ProcessOutput.new('', 0))
94
103
it "should execute the command if the command given includes arguments or subcommands" do
95
104
provider.resource[:path] = ['/bogus/bin']
98
Puppet::Util::Execution.expects(:execute).with { |cmdline, arguments| (cmdline == "#{command} bar --sillyarg=true --blah") && (arguments.is_a? Hash) }.returns(Puppet::Util::Execution::ProcessOutput.new('', 0))
107
Puppet::Util::Execution.expects(:execute).with("#{command} bar --sillyarg=true --blah", instance_of(Hash)).returns(Puppet::Util::Execution::ProcessOutput.new('', 0))
99
109
provider.run("#{command} bar --sillyarg=true --blah")
102
112
it "should fail if quoted command doesn't exist" do
103
113
provider.resource[:path] = ['/bogus/bin']
106
116
expect { provider.run(%Q["#{command}"]) }.to raise_error(ArgumentError, "Could not find command '#{command}'")