Permalink
Browse files

Add a test that the global ENV is passed to the runner

  • Loading branch information...
1 parent dd986aa commit 44cd6590544a0bfbca70f4ed4d56f9b3ebde490e @mike-burns mike-burns committed Aug 29, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 spec/cocaine/command_line_spec.rb
@@ -26,14 +26,20 @@
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 'passes the existing environment variables through to the runner' do
+ command = Cocaine::CommandLine.new('echo', '$HOME')
+ output = command.run
+ output.chomp.should_not == ''
+ end
+
it "can interpolate quoted variables into the command line's parameters" do
cmd = Cocaine::CommandLine.new("convert",
":one :{two}",

0 comments on commit 44cd659

Please sign in to comment.