Sha256: a770d30d3df2beddfe10e0f3ad3777fb006eb7113c5c1d04c92553481c5e437a

Contents?: true

Size: 1.01 KB

Versions: 5

Compression:

Stored size: 1.01 KB

Contents

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

describe Sprinkle::Installers::MacPort do

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

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

  describe 'when created' do

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

  end

  describe 'during installation' do

    before do
      @installer = create_port '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 =~ /port install ruby/
    end

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

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sprinkle-0.7.7 spec/sprinkle/installers/mac_port_spec.rb
sprinkle-0.7.6.2 spec/sprinkle/installers/mac_port_spec.rb
sprinkle-0.7.6.1 spec/sprinkle/installers/mac_port_spec.rb
sprinkle-0.7.6 spec/sprinkle/installers/mac_port_spec.rb
sprinkle-0.7.5 spec/sprinkle/installers/mac_port_spec.rb