Fixed a bug involving double quotes and runner
Signed-off-by: Javan Makhmali <javan@javan.us>
This commit is contained in:
parent
c2272dd3ec
commit
92e727c09e
@ -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
|
||||
|
@ -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
|
Loading…
Reference in New Issue
Block a user