diff options
author | Matt Wrock <matt@mattwrock.com> | 2016-02-25 15:35:34 -0800 |
---|---|---|
committer | Matt Wrock <matt@mattwrock.com> | 2016-02-25 15:35:34 -0800 |
commit | 1cf4e878bf8609fafb76fa2097feb65595aacc4f (patch) | |
tree | 9ea4779b5b99c30483bca111b2b2cf783a1976ea /spec | |
parent | dbedc9c800dad338ecc1b50dd6770ab4e909a782 (diff) | |
parent | b912d1075286261b0e9523cecff1997b59034b75 (diff) | |
download | chef-1cf4e878bf8609fafb76fa2097feb65595aacc4f.tar.gz |
Merge pull request #4626 from chef/umlaut
ensure paths maintain utf-8ness in non ascii encodings
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/mixin/path_sanity_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/unit/mixin/path_sanity_spec.rb b/spec/unit/mixin/path_sanity_spec.rb index e410f034d5..2c26e2fb79 100644 --- a/spec/unit/mixin/path_sanity_spec.rb +++ b/spec/unit/mixin/path_sanity_spec.rb @@ -56,6 +56,12 @@ describe Chef::Mixin::PathSanity do expect(env["PATH"]).to eq("/usr/bin:/sbin:/bin:#{@ruby_bindir}:#{@gem_bindir}:/usr/local/sbin:/usr/local/bin:/usr/sbin") end + it "creates path with utf-8 encoding" do + env = { "PATH" => "/usr/bin:/sbin:/bin:/b\x81t".force_encoding("ISO-8859-1") } + @sanity.enforce_path_sanity(env) + expect(env["PATH"].encoding.to_s).to eq("UTF-8") + end + it "adds the current executing Ruby's bindir and Gem bindir to the PATH" do env = { "PATH" => "" } @sanity.enforce_path_sanity(env) |