Permalink
Browse files

fixes & tests for the jruby_home defaults when changing the torquebox…

…_home
  • Loading branch information...
1 parent eed4614 commit 81caae952b317a365a2e1309bf081867c114e789 @agmcleod agmcleod committed Jan 6, 2013
Showing with 37 additions and 2 deletions.
  1. +5 −2 lib/torquebox/remote_deploy_utils.rb
  2. +32 −0 spec/remote_deploy_spec.rb
@@ -65,10 +65,10 @@ def exec_ruby(archive_file, cmd)
with_config(archive_file) do |config, app_name|
unless config.local
ssh_exec(config, "cd #{config.torquebox_home}/stage/#{app_name}",
- "export PATH=#{config.jruby_home}/bin:$PATH",
+ # "export PATH=#{config.jruby_home}/bin:$PATH",
"export RAILS_ENV=#{config.rack_env}",
"export RACK_ENV=#{config.rack_env}",
- "jruby -S #{cmd}")
+ "#{config.jruby_home}/bin/jruby -S #{cmd}")
else
# not sure what to do here yet
end
@@ -204,6 +204,9 @@ def key(k)
end
def torquebox_home(tbh)
+ if @config.jruby_home == "#{@config.torquebox_home}/jruby"
+ jruby_home("#{tbh}/jruby")
+ end
@config.torquebox_home = tbh
end
@@ -50,6 +50,38 @@
end
end
+ context "change to torquebox home" do
+ subject do
+
+ end
+
+ it "jruby_home should be updated to match torquebox prefix" do
+ object = TorqueBox::RemoteDeploy.configure do
+ torquebox_home "/opt/torquebox/current"
+ hostname "1.2.3.4"
+ port "2222"
+ user "torquebox"
+ key "~/.ssh/id_rsa.pub"
+ sudo true
+ end
+ object.config.jruby_home.should == "/opt/torquebox/current/jruby"
+ end
+
+ it "if jruby_home is changed, then torquebox_home, jruby should not be effected" do
+ object = TorqueBox::RemoteDeploy.configure do
+ torquebox_home "/opt/torquebox/current"
+ jruby_home "~/jruby"
+ hostname "1.2.3.4"
+ port "2222"
+ user "torquebox"
+ key "~/.ssh/id_rsa.pub"
+ sudo true
+ end
+
+ object.config.jruby_home.should == "~/jruby"
+ end
+ end
+
context "overrides" do
subject do
TorqueBox::RemoteDeploy.configure do

0 comments on commit 81caae9

Please sign in to comment.