Merge branch 'pull-435' into stable
Adrien Thebo
11 years ago
168 | 168 |
|
169 | 169 |
begin
|
170 | 170 |
out = %x{#{code}}.chomp
|
171 | |
Facter.warnonce 'Using Facter::Util::Resolution.exec with a shell built-in is deprecated. Most built-ins can be replaced with native ruby commands. If you really have to run a built-in, pass "cmd /c your_builtin" as a command' unless expanded_code
|
|
171 |
Facter.warnonce "Using Facter::Util::Resolution.exec with a shell built-in is deprecated. Most built-ins can be replaced with native ruby commands. If you really have to run a built-in, pass \"cmd /c your_builtin\" as a command (command responsible for this message was \"#{code}\")" unless expanded_code
|
172 | 172 |
rescue Errno::ENOENT => detail
|
173 | 173 |
# command not found on Windows
|
174 | 174 |
return nil
|
684 | 684 |
it "should try to run the command and return output of a shell-builtin" do
|
685 | 685 |
Facter::Util::Resolution.expects(:expand_command).with(%q{echo foo}).returns nil
|
686 | 686 |
Facter::Util::Resolution.expects(:`).with(%q{echo foo}).returns 'foo'
|
687 | |
Facter.expects(:warnonce).with('Using Facter::Util::Resolution.exec with a shell built-in is deprecated. Most built-ins can be replaced with native ruby commands. If you really have to run a built-in, pass "cmd /c your_builtin" as a command')
|
|
687 |
Facter.expects(:warnonce).with 'Using Facter::Util::Resolution.exec with a shell built-in is deprecated. Most built-ins can be replaced with native ruby commands. If you really have to run a built-in, pass "cmd /c your_builtin" as a command (command responsible for this message was "echo foo")'
|
688 | 688 |
Facter::Util::Resolution.exec(%q{echo foo}).should == 'foo'
|
689 | 689 |
end
|
690 | 690 |
it "should try to run the command and return nil if not shell-builtin" do
|