Sha256: 42996706f809fce72aa8c3179e35daa7d0b42bbfe04af2a04e31fc1756f76203

Contents?: true

Size: 1.74 KB

Versions: 11

Compression:

Stored size: 1.74 KB

Contents

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

describe Sprinkle::Installers::Brew do

  before do
    @formula = mock(Sprinkle::Package, :name => 'formula', :sudo? => false)
  end

  def create_brew(*formulas, &block)
    Sprinkle::Installers::Brew.new(@formula, *formulas, &block)
  end

  describe 'when created' do

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

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

    it 'should remove options from packages list' do
      @installer = create_brew 'ruby'
      @installer.packages.should == [ 'ruby' ]
    end

  end

  describe 'during installation' do

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

    it 'should invoke the apt installer for all specified packages' do
      @install_commands.should =~ /brew install ruby/
    end

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

  end
  
  # describe 'during dependencies only installation' do
  # 
  #   before do
  #     @installer = create_apt('ruby') { dependencies_only true }
  #     @install_commands = @installer.send :install_commands
  #   end
  # 
  #   it 'should invoke the apt installer with build-dep command for all specified packages' do
  #     @install_commands.should =~ /apt-get --force-yes -qyu build-dep ruby/
  #   end
  #   
  # end
end

Version data entries

11 entries across 11 versions & 1 rubygems

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