Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing Sprinkle::Installers::Transfer pre and post hooks.

  • Loading branch information...
commit fa300fda9494ee4357b322928afbbff720a4e431 1 parent ac1f2fb
@nicolasblanco nicolasblanco authored
View
4 lib/sprinkle/installers/transfer.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].flatten, 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].flatten, roles
end
end
end
View
4 spec/sprinkle/installers/transfer_spec.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.