Fixed a bug involving double quotes and runner

Signed-off-by: Javan Makhmali <javan@javan.us>
This commit is contained in:
Sam Ruby 2009-07-09 22:57:14 +08:00 committed by Javan Makhmali
parent c2272dd3ec
commit 92e727c09e
2 changed files with 18 additions and 2 deletions

View File

@ -4,7 +4,7 @@ module Whenever
def output
path_required
%Q(#{File.join(@path, 'script', 'runner')} -e #{@environment} "#{task}")
%Q(#{File.join(@path, 'script', 'runner')} -e #{@environment} #{task.inspect})
end
end

View File

@ -190,4 +190,20 @@ class OutputRunnerTest < Test::Unit::TestCase
end
end
context "A runner which makes use of double quotes" do
setup do
@output = Whenever.cron \
<<-file
set :path, '/my/path'
every 2.hours do
runner 'Product.import("http://example.com/product.xml")'
end
file
end
should "output the runner using the original environmnet" do
assert_match two_hours + ' /my/path/script/runner -e production "Product.import(\"http://example.com/product.xml\")"', @output
end
end
end