Sha256: 885da18d67b2e1a78a51417944595e815bfbd5be8f084c64bf97e91ff5df184b

Contents?: true

Size: 1.36 KB

Versions: 13

Compression:

Stored size: 1.36 KB

Contents

require File.expand_path("../../spec_helper", File.dirname(__FILE__))

describe Sprinkle::Installers::Runner do

	before do
		@package = mock(Sprinkle::Package, :name => 'package', :sudo? => false)
	end

	def create_runner(*cmds)
	  options=cmds.extract_options!
		Sprinkle::Installers::Runner.new(@package, cmds, options)
	end

	describe 'when created' do
		it 'should accept a single cmd to run' do
			@installer = create_runner 'teste'
			@installer.cmds.should == ['teste']
		end
		
		it 'should accept an array of commands to run' do
			@installer = create_runner ['teste', 'world']
			@installer.cmds.should == ['teste', 'world']
			@installer.install_sequence.should == ['teste', 'world']
	  end
	end

	describe 'during installation' do
		
		it 'should use sudo if specified locally' do
		  @installer = create_runner 'teste', :sudo => true
		  @install_commands = @installer.send :install_commands
		  @install_commands.should == ['sudo teste']
	  end
	  
	  it "should accept multiple commands" do
	    @installer = create_runner 'teste', 'test2'
	    @install_commands = @installer.send :install_commands
	    @install_commands.should == ['teste','test2']
    end

		it 'should run the given command for all specified packages' do
		  @installer = create_runner 'teste'
			@install_commands = @installer.send :install_commands
			@install_commands.should == ['teste']
		end
	end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
sprinkle-0.7.2 spec/sprinkle/installers/runner_spec.rb
sprinkle-0.7.1.1 spec/sprinkle/installers/runner_spec.rb
sprinkle-0.7.1 spec/sprinkle/installers/runner_spec.rb
sprinkle-0.7 spec/sprinkle/installers/runner_spec.rb
sprinkle-0.6.2 spec/sprinkle/installers/runner_spec.rb
sprinkle-0.6.1.1 spec/sprinkle/installers/runner_spec.rb
sprinkle-0.6.1 spec/sprinkle/installers/runner_spec.rb
sprinkle-0.6.0 spec/sprinkle/installers/runner_spec.rb
sprinkle-0.5.2 spec/sprinkle/installers/runner_spec.rb
sprinkle-0.5.1.1 spec/sprinkle/installers/runner_spec.rb
sprinkle-0.5.1 spec/sprinkle/installers/runner_spec.rb
sprinkle-0.5.0 spec/sprinkle/installers/runner_spec.rb
sprinkle-0.5.0.rc1 spec/sprinkle/installers/runner_spec.rb