Skip to content

Commit

Permalink
In order to use bundler you must change to the directory where Gemfil…
Browse files Browse the repository at this point in the history
…e exists

* Change runner command to cd to directory prior to running script/runner
  • Loading branch information
mguterl authored and javan committed Apr 26, 2010
1 parent 22d34a5 commit cd92f1f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/whenever/job_types/runner.rb
Expand Up @@ -4,7 +4,7 @@ class Runner < Whenever::Job::Default

def output
path_required
%Q(#{File.join(@path, 'script', 'runner')} -e #{@environment} #{task.inspect})
%Q(cd #{File.join(@path)} && script/runner -e #{@environment} #{task.inspect})
end

end
Expand Down
6 changes: 3 additions & 3 deletions test/output_at_test.rb
Expand Up @@ -91,7 +91,7 @@ class OutputAtTest < Test::Unit::TestCase
end

should "output the runner using one entry because the times are aligned" do
assert_match '2 5,15 * * 1,3,5 /your/path/script/runner -e production "blahblah"', @output
assert_match '2 5,15 * * 1,3,5 cd /your/path && script/runner -e production "blahblah"', @output
end
end

Expand Down Expand Up @@ -168,9 +168,9 @@ class OutputAtTest < Test::Unit::TestCase

should "output all of the commands @daily" do
assert_match '@daily cd /your/path && RAILS_ENV=production /usr/bin/env rake blah:blah', @output
assert_match '@daily /your/path/script/runner -e production "runner_1"', @output
assert_match '@daily cd /your/path && script/runner -e production "runner_1"', @output
assert_match '@daily command_1', @output
assert_match '@daily /your/path/script/runner -e production "runner_2"', @output
assert_match '@daily cd /your/path && script/runner -e production "runner_2"', @output
assert_match '@daily command_2', @output
end
end
Expand Down
22 changes: 11 additions & 11 deletions test/output_runner_test.rb
Expand Up @@ -14,7 +14,7 @@ class OutputRunnerTest < Test::Unit::TestCase
end

should "output the runner using that path" do
assert_match two_hours + ' /my/path/script/runner -e production "blahblah"', @output
assert_match two_hours + ' cd /my/path && script/runner -e production "blahblah"', @output
end
end

Expand All @@ -30,7 +30,7 @@ class OutputRunnerTest < Test::Unit::TestCase
end

should "output the runner using that path" do
assert_match two_hours + ' /some/other/path/script/runner -e production "blahblah"', @output
assert_match two_hours + ' cd /some/other/path && script/runner -e production "blahblah"', @output
end
end

Expand All @@ -47,7 +47,7 @@ class OutputRunnerTest < Test::Unit::TestCase
end

should "output the runner using that path" do
assert_match two_hours + ' /my/path/script/runner -e production "blahblah"', @output
assert_match two_hours + ' cd /my/path && script/runner -e production "blahblah"', @output
end
end

Expand All @@ -65,7 +65,7 @@ class OutputRunnerTest < Test::Unit::TestCase
end

should "use the path" do
assert_match two_hours + ' /my/path/script/runner -e production "blahblah"', @output
assert_match two_hours + ' cd /my/path && script/runner -e production "blahblah"', @output
assert_no_match /\/rails\/path/, @output
end
end
Expand Down Expand Up @@ -101,7 +101,7 @@ class OutputRunnerTest < Test::Unit::TestCase
end

should "output the runner using that environment" do
assert_match two_hours + ' /my/path/script/runner -e silly "blahblah"', @output
assert_match two_hours + ' cd /my/path && script/runner -e silly "blahblah"', @output
end
end

Expand All @@ -118,7 +118,7 @@ class OutputRunnerTest < Test::Unit::TestCase
end

should "output the runner using that environment" do
assert_match two_hours + ' /my/path/script/runner -e serious "blahblah"', @output
assert_match two_hours + ' cd /my/path && script/runner -e serious "blahblah"', @output
end
end

Expand All @@ -135,7 +135,7 @@ class OutputRunnerTest < Test::Unit::TestCase
end

should "output the runner using the override environment" do
assert_match two_hours + ' /my/path/script/runner -e serious "blahblah"', @output
assert_match two_hours + ' cd /my/path && script/runner -e serious "blahblah"', @output
end
end

Expand All @@ -152,7 +152,7 @@ class OutputRunnerTest < Test::Unit::TestCase
end

should "output the runner using the overridden path and environment" do
assert_match two_hours + ' /serious/path/script/runner -e serious "blahblah"', @output
assert_match two_hours + ' cd /serious/path && script/runner -e serious "blahblah"', @output
end
end

Expand All @@ -169,7 +169,7 @@ class OutputRunnerTest < Test::Unit::TestCase
end

should "output the runner using the overridden path and environment" do
assert_match two_hours + ' /serious/path/script/runner -e serious "blahblah"', @output
assert_match two_hours + ' cd /serious/path && script/runner -e serious "blahblah"', @output
end
end

Expand All @@ -186,7 +186,7 @@ class OutputRunnerTest < Test::Unit::TestCase
end

should "output the runner using the original environmnet" do
assert_match two_hours + ' /silly/path/script/runner -e silly "blahblah"', @output
assert_match two_hours + ' cd /silly/path && script/runner -e silly "blahblah"', @output
end
end

Expand All @@ -202,7 +202,7 @@ class OutputRunnerTest < Test::Unit::TestCase
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
assert_match two_hours + ' cd /my/path && script/runner -e production "Product.import(\"http://example.com/product.xml\")"', @output
end
end

Expand Down

0 comments on commit cd92f1f

Please sign in to comment.