Skip to content

Commit

Permalink
a deploy saves the ouput and the status from the rake command
Browse files Browse the repository at this point in the history
  • Loading branch information
dcrec1 committed Oct 22, 2009
1 parent b026657 commit 94a55f7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
17 changes: 14 additions & 3 deletions spec/models/deploy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,23 @@
before :each do
fail_on_command
File.stub!(:open).and_return(mock(Object, :read => "lorem ipsum"))
@project = Project.new :name => "inploy"
end

it "should deploy the project raking inploy:remote:update" do
project = Project.new :name => "inploy"
expect_for "cd #{project.send :path} && rake inploy:remote:update > #{project.send :log_path} 2>&1"
Deploy.create! :project => project
expect_for "cd #{@project.send :path} && rake inploy:remote:update > #{@project.send :log_path} 2>&1"
Deploy.create! :project => @project
end

it "should save the log" do
log = "Can't touch this!"
File.stub!(:open).with(@project.send :log_path).and_return(mock(Object, :read => log))
Deploy.create!(:project => @project).output.should eql(log)
end

it "should determine if the deploy was a success or not" do
success_on_command
Deploy.create!(:project => @project).success.should be_true
end
end
end
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
end

require File.expand_path(File.dirname(__FILE__) + '/resource_helper')
require File.expand_path(File.dirname(__FILE__) + '/shared_examples')

require "email_spec/helpers"
require "email_spec/matchers"
Expand Down

0 comments on commit 94a55f7

Please sign in to comment.