Sha256: e76d0957b3d9467140d5022590ba607f47c9c169cee8336fb13635ff37ec1657

Contents?: true

Size: 1.59 KB

Versions: 45

Compression:

Stored size: 1.59 KB

Contents

require 'spec_helper'

class ClassMixedWithDSLWrappers
  include Beaker::DSL::Wrappers
end

describe ClassMixedWithDSLWrappers do
  let(:opts)  { {'ENV' => default_opts} }
  let(:default_opts) { Beaker::Command::DEFAULT_GIT_ENV }
  describe '#facter' do
    it 'should split out the options and pass "facter" as first arg to Command' do
      Beaker::Command.should_receive( :new ).
        with('facter', [ '-p' ], opts)
      subject.facter( '-p' )
    end
  end

  describe '#hiera' do
    it 'should split out the options and pass "hiera" as first arg to Command' do
      Beaker::Command.should_receive( :new ).
        with('hiera', [ '-p' ], opts)
      subject.hiera( '-p' )
    end
  end

  describe '#puppet' do
    it 'should split out the options and pass "puppet <blank>" to Command' do
      merged_opts = {}
      merged_opts['ENV'] = {:HOME => '/'}.merge( default_opts )
      merged_opts[:server] = 'master'
      Beaker::Command.should_receive( :new ).
        with('puppet agent', [ '-tv' ], merged_opts)
      subject.puppet( 'agent', '-tv', :server => 'master', 'ENV' => {:HOME => '/'})
    end
  end

  describe '#host_command' do
    it 'delegates to HostCommand.new' do
      Beaker::HostCommand.should_receive( :new ).with( 'blah' )
      subject.host_command( 'blah' )
    end
  end

  describe 'deprecated puppet wrappers' do
    %w( resource doc kick cert apply master agent filebucket ).each do |sub|
      it "#{sub} delegates the proper info to #puppet" do
        subject.should_receive( :puppet ).with( sub, 'blah' )
        subject.send( "puppet_#{sub}", 'blah')
      end
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
beaker-1.12.2 spec/beaker/dsl/wrappers_spec.rb
beaker-1.11.1 spec/beaker/dsl/wrappers_spec.rb
beaker-1.11.0 spec/beaker/dsl/wrappers_spec.rb
beaker-1.10.0 spec/beaker/dsl/wrappers_spec.rb
beaker-1.9.1 spec/beaker/dsl/wrappers_spec.rb
beaker-1.9.0 spec/beaker/dsl/wrappers_spec.rb
beaker-1.8.2 spec/beaker/dsl/wrappers_spec.rb
beaker-1.8.1 spec/beaker/dsl/wrappers_spec.rb
beaker-1.8.0 spec/beaker/dsl/wrappers_spec.rb
beaker-1.7.0 spec/beaker/dsl/wrappers_spec.rb
beaker-1.6.2 spec/beaker/dsl/wrappers_spec.rb
beaker-1.6.1 spec/beaker/dsl/wrappers_spec.rb
beaker-1.6.0 spec/beaker/dsl/wrappers_spec.rb
beaker-1.5.0 spec/beaker/dsl/wrappers_spec.rb
beaker-1.4.1 spec/beaker/dsl/wrappers_spec.rb
beaker-1.4.0 spec/beaker/dsl/wrappers_spec.rb
beaker-1.3.2 spec/beaker/dsl/wrappers_spec.rb
beaker-1.3.1 spec/beaker/dsl/wrappers_spec.rb
beaker-1.3.0 spec/beaker/dsl/wrappers_spec.rb
beaker-1.2.0 spec/beaker/dsl/wrappers_spec.rb