diff options
author | Matt Wrock <matt@mattwrock.com> | 2016-02-24 20:27:56 -0800 |
---|---|---|
committer | Matt Wrock <matt@mattwrock.com> | 2016-02-24 20:27:56 -0800 |
commit | b912d1075286261b0e9523cecff1997b59034b75 (patch) | |
tree | 1aea8c311c4a800e646f1ab0841e828b4812d1b0 /spec/unit/mixin | |
parent | 1967e8c24ff5990f5352cec4ae84691b1643b2e1 (diff) | |
download | chef-b912d1075286261b0e9523cecff1997b59034b75.tar.gz |
ensure paths maintain utf-8ness in non ascii encodingsumlaut
Diffstat (limited to 'spec/unit/mixin')
-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) |