Skip to content

Commit

Permalink
Fixing Sprinkle::Installers::Transfer pre and post hooks.
Browse files Browse the repository at this point in the history
  • Loading branch information
slainer68 committed Aug 24, 2011
1 parent ac1f2fb commit fa300fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/sprinkle/installers/transfer.rb
Expand Up @@ -135,7 +135,7 @@ def process(roles) #:nodoc:
unless pre.empty?
sequence = pre; sequence = sequence.join('; ') if sequence.is_a? Array
logger.info "#{@package.name} pre-transfer commands: #{sequence} for roles: #{roles}\n"
@delivery.process @package.name, sequence, roles
@delivery.process @package.name, [pre].flatten, roles
end

recursive = @options[:recursive]
Expand Down Expand Up @@ -169,7 +169,7 @@ def process(roles) #:nodoc:
unless post.empty?
sequence = post; sequence = sequence.join('; ') if sequence.is_a? Array
logger.info "#{@package.name} post-transfer commands: #{sequence} for roles: #{roles}\n"
@delivery.process @package.name, sequence, roles
@delivery.process @package.name, [post].flatten, roles
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/sprinkle/installers/transfer_spec.rb
Expand Up @@ -42,9 +42,9 @@ def create_transfer(source, dest, options={}, &block)
end

it "should call the pre and post install commands around the file transfer" do
@delivery.should_receive(:process).with(@package.name, 'op1', @roles).once.ordered.and_return
@delivery.should_receive(:process).with(@package.name, ['op1'], @roles).once.ordered.and_return
@delivery.should_receive(:transfer).ordered.and_return
@delivery.should_receive(:process).with(@package.name, 'op2', @roles).once.ordered.and_return
@delivery.should_receive(:process).with(@package.name, ['op2'], @roles).once.ordered.and_return
end

it "should call transfer with recursive defaulted to nil" do
Expand Down

0 comments on commit fa300fd

Please sign in to comment.