Sha256: 91edd9d018aac8dc58192c2c56aabdc8eac4bc9caf9e828c5707072bc29540d1

Contents?: true

Size: 1.36 KB

Versions: 10

Compression:

Stored size: 1.36 KB

Contents

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

describe Sprinkle::Installers::Rpm do

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

  def create_rpm(debs, &block)
    Sprinkle::Installers::Rpm.new(@package, debs, &block)
  end

  describe 'when created' do

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

    it 'should accept an array of packages to install' do
      @installer = create_rpm %w( gcc gdb g++ )
      @installer.packages.should == ['gcc', 'gdb', 'g++']
    end
    
    it 'should accept a list of packages to install' do
      @installer = Sprinkle::Installers::Rpm.new(@package, "gcc", "gdb", "g++")
      @installer.packages.should == ['gcc', 'gdb', 'g++']
    end

  end

  describe 'during installation' do

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

    it 'should invoke the rpm installer for all specified packages' do
      @install_commands.should =~ /rpm -Uvh ruby/
    end

    it 'should automatically insert pre/post commands for the specified package' do
      @installer.send(:install_sequence).should == [ 'op1', 'rpm -Uvh ruby', 'op2' ]
    end

  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
sprinkle-0.7.4 spec/sprinkle/installers/rpm_spec.rb
sprinkle-0.7.3 spec/sprinkle/installers/rpm_spec.rb
sprinkle-0.7.2 spec/sprinkle/installers/rpm_spec.rb
sprinkle-0.7.1.1 spec/sprinkle/installers/rpm_spec.rb
sprinkle-0.7.1 spec/sprinkle/installers/rpm_spec.rb
sprinkle-0.7 spec/sprinkle/installers/rpm_spec.rb
sprinkle-0.6.2 spec/sprinkle/installers/rpm_spec.rb
sprinkle-0.6.1.1 spec/sprinkle/installers/rpm_spec.rb
sprinkle-0.6.1 spec/sprinkle/installers/rpm_spec.rb
sprinkle-0.6.0 spec/sprinkle/installers/rpm_spec.rb