Sha256: d7239188ff910c39681ab5f3f9097674eb8c3e85c952c6131f773cef2078d17e

Contents?: true

Size: 994 Bytes

Versions: 4

Compression:

Stored size: 994 Bytes

Contents

require 'spec_helper_system'

describe "helper puppet_apply" do
  it 'should print notice message to stdout' do
    puppet_apply('notice("foo")') do |r|
      r.stdout.should =~ /foo/
      r.stderr.should be_empty
      r.exit_code.should be_zero
    end
  end

  it 'in debug mode should return notice message to stdout and Debug: labels' do
    puppet_apply(:code => 'notice("foo")', :debug => true) do |r|
      r.stdout.should =~ /foo/
      r.stdout.should =~ /Debug:/
      r.stderr.should be_empty
      r.exit_code.should be_zero
    end
  end

  it 'with trace off it should work normally' do
    puppet_apply(:code => 'notice("foo")', :trace => false) do |r|
      r.stdout.should =~ /foo/
      r.stderr.should be_empty
      r.exit_code.should be_zero
    end
  end

  context 'test as a subject' do
    context puppet_apply 'notice("foo")' do
      its(:stdout) { should =~ /foo/ }
      its(:stderr) { should be_empty }
      its(:exit_code) { should be_zero }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rspec-system-puppet-2.2.1 spec/system/puppet_apply_spec.rb
rspec-system-puppet-2.2.0 spec/system/puppet_apply_spec.rb
rspec-system-puppet-2.1.0 spec/system/puppet_apply_spec.rb
rspec-system-puppet-2.0.0 spec/system/puppet_apply_spec.rb