Permalink
Browse files

Merge pull request #151 from joshcooper/ticket/master/12012-env-lang-…

…windows

(#12012) Fix ENV['LANG'] spec tests on Windows
  • Loading branch information...
2 parents 362adf5 + c93922c commit 19090296cfe0d08088c27d13710934baaf499a0e @slippycheeze slippycheeze committed Jan 21, 2012
Showing with 9 additions and 3 deletions.
  1. +9 −3 spec/unit/util/resolution_spec.rb
@@ -342,16 +342,22 @@
end
it "should execute the binary" do
- Facter::Util::Resolution.exec("echo foo").should == "foo"
+ Facter::Util::Resolution.exec(
+ Facter::Util::Config.is_windows? ? 'cmd.exe /c "echo foo"' : 'echo foo'
+ ).should == "foo"
end
it "should override the LANG environment variable" do
- Facter::Util::Resolution.exec("echo $LANG").should == "C"
+ Facter::Util::Resolution.exec(
+ Facter::Util::Config.is_windows? ? 'cmd.exe /c "echo %LANG%"' : 'echo $LANG'
+ ).should == "C"
end
it "should respect other overridden environment variables" do
Facter::Util::Resolution.with_env( {"FOO" => "foo"} ) do
- Facter::Util::Resolution.exec("echo $FOO").should == "foo"
+ Facter::Util::Resolution.exec(
+ Facter::Util::Config.is_windows? ? 'cmd.exe /c "echo %FOO%"' : 'echo $FOO'
+ ).should == "foo"
end
end
end

0 comments on commit 1909029

Please sign in to comment.