Merge branch 'master' of https://github.com/teejayvanslyke/whenever into teejayvanslyke-master

This commit is contained in:
Javan Makhmali 2011-03-06 16:11:49 -05:00
commit 006a1d963b
2 changed files with 12 additions and 2 deletions

View File

@ -88,7 +88,7 @@ module Whenever
output = [] output = []
@env.each do |key, val| @env.each do |key, val|
output << "#{key}=#{val}\n" output << "#{key}=#{val.blank? ? '""' : val}\n"
end end
output << "\n" output << "\n"

View File

@ -8,6 +8,8 @@ class OutputEnvTest < Test::Unit::TestCase
<<-file <<-file
env :MYVAR, 'blah' env :MYVAR, 'blah'
env 'MAILTO', "someone@example.com" env 'MAILTO', "someone@example.com"
env :BLANKVAR, ''
env :NILVAR, nil
file file
end end
@ -18,6 +20,14 @@ class OutputEnvTest < Test::Unit::TestCase
should "output MAILTO environment variable" do should "output MAILTO environment variable" do
assert_match "MAILTO=someone@example.com", @output assert_match "MAILTO=someone@example.com", @output
end end
should "output BLANKVAR environment variable" do
assert_match "BLANKVAR=\"\"", @output
end
should "output NILVAR environment variable" do
assert_match "NILVAR=\"\"", @output
end
end end
end end