Sha256: 699108a81815138f6d3b5fe8752f24140fd9e4b3cc767d6d2a20e09f5dfadeae

Contents?: true

Size: 1.43 KB

Versions: 21

Compression:

Stored size: 1.43 KB

Contents

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

describe Sprinkle::Installers::Zypper do

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

  def create_zypper(*packages, &block)
    Sprinkle::Installers::Zypper.new(@package, *packages, &block)
  end

  describe 'when created' do

    it 'should accept a single package to install' do
      @installer = create_zypper 'ruby'
      @installer.packages.should == [ 'ruby' ]
    end

    it 'should accept an array of packages to install' do
      @installer = create_zypper %w( gcc gdb g++ )
      @installer.packages.should == ['gcc', 'gdb', 'g++']
    end

    it 'should accept an argument list of packages to install' do
      @installer = create_zypper "gcc", "gdb", "g++"
      @installer.packages.should == ['gcc', 'gdb', 'g++']
    end
  end

  describe 'during installation' do

    before do
      @installer = create_zypper 'ruby', 'rubygems' do
        pre :install, 'op1'
        post :install, 'op2'
      end
      @install_commands = @installer.send :install_commands
    end

    it 'should invoke the zypper installer for all specified packages' do
      @install_commands.should =~ /zypper -n install -l -R ruby rubygems/
    end

    it 'should automatically insert pre/post commands for the specified package' do
      @installer.send(:install_sequence).should == [ 'op1', 'zypper -n install -l -R ruby rubygems', 'op2' ]
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
sprinkle-0.7.4 spec/sprinkle/installers/zypper_spec.rb
sprinkle-0.7.3 spec/sprinkle/installers/zypper_spec.rb
sprinkle-0.7.2 spec/sprinkle/installers/zypper_spec.rb
sprinkle-0.7.1.1 spec/sprinkle/installers/zypper_spec.rb
sprinkle-0.7.1 spec/sprinkle/installers/zypper_spec.rb
sprinkle-0.7 spec/sprinkle/installers/zypper_spec.rb
sprinkle-0.6.2 spec/sprinkle/installers/zypper_spec.rb
sprinkle-0.6.1.1 spec/sprinkle/installers/zypper_spec.rb
sprinkle-0.6.1 spec/sprinkle/installers/zypper_spec.rb
sprinkle-0.6.0 spec/sprinkle/installers/zypper_spec.rb
sprinkle-0.5.2 spec/sprinkle/installers/zypper_spec.rb
sprinkle-0.5.1.1 spec/sprinkle/installers/zypper_spec.rb
sprinkle-0.5.1 spec/sprinkle/installers/zypper_spec.rb
sprinkle-0.5.0 spec/sprinkle/installers/zypper_spec.rb
sprinkle-0.5.0.rc1 spec/sprinkle/installers/zypper_spec.rb
sprinkle-0.4.2 spec/sprinkle/installers/zypper_spec.rb
sprinkle-0.4.1 spec/sprinkle/installers/zypper_spec.rb
sprinkle-0.4.0 spec/sprinkle/installers/zypper_spec.rb
sprinkle-0.3.6 spec/sprinkle/installers/zypper_spec.rb
sprinkle-0.3.5 spec/sprinkle/installers/zypper_spec.rb