Codebase list facter / 547cf56
Merge branch 'pull-435' into stable Adrien Thebo 11 years ago
2 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
168168
169169 begin
170170 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
172172 rescue Errno::ENOENT => detail
173173 # command not found on Windows
174174 return nil
684684 it "should try to run the command and return output of a shell-builtin" do
685685 Facter::Util::Resolution.expects(:expand_command).with(%q{echo foo}).returns nil
686686 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")'
688688 Facter::Util::Resolution.exec(%q{echo foo}).should == 'foo'
689689 end
690690 it "should try to run the command and return nil if not shell-builtin" do