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.21.0 spec/beaker/dsl/wrappers_spec.rb
beaker-1.20.1 spec/beaker/dsl/wrappers_spec.rb
beaker-1.20.0 spec/beaker/dsl/wrappers_spec.rb
beaker-1.19.1 spec/beaker/dsl/wrappers_spec.rb
beaker-1.19.0 spec/beaker/dsl/wrappers_spec.rb
beaker-1.18.0 spec/beaker/dsl/wrappers_spec.rb
beaker-1.17.7 spec/beaker/dsl/wrappers_spec.rb
beaker-1.17.6 spec/beaker/dsl/wrappers_spec.rb
beaker-1.17.5 spec/beaker/dsl/wrappers_spec.rb
beaker-1.17.4 spec/beaker/dsl/wrappers_spec.rb
beaker-1.17.3 spec/beaker/dsl/wrappers_spec.rb
beaker-1.17.2 spec/beaker/dsl/wrappers_spec.rb
beaker-1.17.1 spec/beaker/dsl/wrappers_spec.rb
beaker-1.17.0 spec/beaker/dsl/wrappers_spec.rb
beaker-1.16.0 spec/beaker/dsl/wrappers_spec.rb
beaker-1.15.0 spec/beaker/dsl/wrappers_spec.rb
beaker-1.14.1 spec/beaker/dsl/wrappers_spec.rb
beaker-1.14.0 spec/beaker/dsl/wrappers_spec.rb
beaker-1.13.1 spec/beaker/dsl/wrappers_spec.rb
beaker-1.13.0 spec/beaker/dsl/wrappers_spec.rb