From eb4d98fc2ec439d9a719ad4ed7e1c35d9fa6ceb6 Mon Sep 17 00:00:00 2001 From: Ivo van Hurne Date: Fri, 13 Apr 2012 12:59:00 +0200 Subject: [PATCH] Added test for custom environment variables --- spec/cocaine/command_line_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/cocaine/command_line_spec.rb b/spec/cocaine/command_line_spec.rb index 5ec6114..12683f7 100644 --- a/spec/cocaine/command_line_spec.rb +++ b/spec/cocaine/command_line_spec.rb @@ -26,6 +26,13 @@ output.should match(%r{/path/to/command/dir}) output.should match(%r{/some/other/path}) end + + it "temporarily changes specified environment variables" do + Cocaine::CommandLine.environment['TEST'] = 'Hello, world!' + cmd = Cocaine::CommandLine.new("ruby", "-e 'puts ENV[%{TEST}]'") + output = cmd.run + output.should match(%r{Hello, world!}) + end it "can interpolate quoted variables into the command line's parameters" do cmd = Cocaine::CommandLine.new("convert",