Sha256: d09342f2380f6b527343e618b04b4ab7cd0bd291bb7c60b488aa7f5a9c4a8799

Contents?: true

Size: 1.05 KB

Versions: 7

Compression:

Stored size: 1.05 KB

Contents

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

describe Sprinkle::Installers::FreebsdPortinstall do

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

  def create_port(ports, &block)
    Sprinkle::Installers::FreebsdPortinstall.new(@package, ports, &block)
  end

  describe 'when created' do

    it 'should accept a single package to install' do
      @installer = create_port 'lang/ruby'
      @installer.port.should == 'lang/ruby'
    end

  end

  describe 'during installation' do

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

    it 'should invoke the port installer for all specified packages' do
      @install_commands.should =~ /portinstall --batch lang\/ruby/
    end

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

  end

end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
dhill-sprinkle-0.3.3.1 spec/sprinkle/installers/freebsd_portinstall_spec.rb
sprinkle-0.3.3 spec/sprinkle/installers/freebsd_portinstall_spec.rb
sprinkle-0.3.2 spec/sprinkle/installers/freebsd_portinstall_spec.rb
powcloud-sprinkle-0.3.4 spec/sprinkle/installers/freebsd_portinstall_spec.rb
powcloud-sprinkle-0.3.0 spec/sprinkle/installers/freebsd_portinstall_spec.rb
sprinkle-0.3.1 spec/sprinkle/installers/freebsd_portinstall_spec.rb
sprinkle-0.3.0 spec/sprinkle/installers/freebsd_portinstall_spec.rb