Permalink
Browse files

[FIX] Handle multiple commands in transfer installer correctly

  • Loading branch information...
1 parent 581ba7a commit 638e7acb3a3f4fbae919e67d2b0f865df4be49ed @crafterm committed Sep 9, 2011
Showing with 6 additions and 6 deletions.
  1. +2 −2 lib/sprinkle/installers/transfer.rb
  2. +4 −4 spec/sprinkle/installers/transfer_spec.rb
@@ -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, roles
end
recursive = @options[:recursive]
@@ -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, roles
end
end
end
@@ -44,9 +44,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).and_return
+ @delivery.should_receive(:process).with(@package.name, ['op1'], @roles).and_return
@delivery.should_receive(:transfer).and_return
- @delivery.should_receive(:process).with(@package.name, 'op2', @roles).and_return
+ @delivery.should_receive(:process).with(@package.name, ['op2'], @roles).and_return
end
it "should call transfer with recursive defaulted to nil" do
@@ -67,9 +67,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; op1-1', @roles).and_return
+ @delivery.should_receive(:process).with(@package.name, ['op1', 'op1-1'], @roles).and_return
@delivery.should_receive(:transfer).and_return
- @delivery.should_receive(:process).with(@package.name, 'op2; op2-1', @roles).and_return
+ @delivery.should_receive(:process).with(@package.name, ['op2', 'op2-1'], @roles).and_return
end
end

0 comments on commit 638e7ac

Please sign in to comment.