Sha256: a5071ac0203ad6d4b87e17157b1c067f1d50099b720d1287173abb4190d5b121

Contents?: true

Size: 834 Bytes

Versions: 2

Compression:

Stored size: 834 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper'

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

  def create_custom(command, &block)
    Sprinkle::Installers::Custom.new(@package, command, &block)
  end

  describe 'during installation' do
    before do
      @installer = create_custom 'adduser test' 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 =~ /adduser test/
    end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jemmyw-sprinkle-0.2.3 spec/sprinkle/installers/custom_spec.rb
jemmyw-sprinkle-0.2.4 spec/sprinkle/installers/custom_spec.rb