Skip to content

Commit

Permalink
Test quote in env var does not make it to export
Browse files Browse the repository at this point in the history
From heroku/heroku-buildpack-ruby#967. I'm moving the behavior from an integration test to a unit test.
  • Loading branch information
schneems committed Oct 29, 2020
1 parent 80ee9d3 commit e1b229e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions spec/unit/env_proxy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ def unique_env_key
key
end

it "does not let special characters in env vars affect exporting" do
env_var = HerokuBuildpackRuby::EnvProxy.path(unique_env_key)
ENV[env_var.key] = "a\nb"
env_var.prepend(foo: "c")

expect(env_var.value).to eq("c:a\nb")
expect(env_var.to_export).to eq(%Q{export #{env_var.key}="c:$#{env_var.key}"})
ensure
HerokuBuildpackRuby::EnvProxy.delete(env_var)
end

it "lol example" do
env_var = HerokuBuildpackRuby::EnvProxy.path(unique_env_key)
env_var.prepend(foo: ["/app/lol", "haha"])
Expand Down

0 comments on commit e1b229e

Please sign in to comment.