diff --git a/spec/unit/util/diff_spec.rb b/spec/unit/util/diff_spec.rb index 9f401075b..b1b5bd62b 100755 --- a/spec/unit/util/diff_spec.rb +++ b/spec/unit/util/diff_spec.rb @@ -1,30 +1,31 @@ -#!/usr/bin/env rspec +#!/usr/bin/env ruby -S rspec require 'spec_helper' require 'puppet/util/diff' +require 'puppet/util/execution' describe Puppet::Util::Diff do describe ".diff" do it "should execute the diff command with arguments" do Puppet[:diff] = 'foo' Puppet[:diff_args] = 'bar' - subject.expects(:execute).with(['foo', 'bar', 'a', 'b'], {:failonfail => false}).returns('baz') + Puppet::Util::Execution.expects(:execute).with(['foo', 'bar', 'a', 'b'], {:failonfail => false}).returns('baz') subject.diff('a', 'b').should == 'baz' end it "should omit diff arguments if none are specified" do Puppet[:diff] = 'foo' Puppet[:diff_args] = '' - subject.expects(:execute).with(['foo', 'a', 'b'], {:failonfail => false}).returns('baz') + Puppet::Util::Execution.expects(:execute).with(['foo', 'a', 'b'], {:failonfail => false}).returns('baz') subject.diff('a', 'b').should == 'baz' end it "should return empty string if the diff command is empty" do Puppet[:diff] = '' - subject.expects(:execute).never + Puppet::Util::Execution.expects(:execute).never subject.diff('a', 'b').should == '' end end end