Sha256: 8ac6d3850924de60509136278f1734d2c4f1c556afd36531a5deff701567af10

Contents?: true

Size: 917 Bytes

Versions: 25

Compression:

Stored size: 917 Bytes

Contents

#!/usr/bin/env rspec
require 'spec_helper'
require 'puppet/application/facts'

describe Puppet::Application::Facts do
  before :each do
    subject.command_line.stubs(:subcommand_name).returns 'facts'
  end

  it "should fail if no key is given to find" do
    subject.command_line.stubs(:args).returns %w{find}
    expect {
      expect { subject.run }.to exit_with 1
    }.to have_printed /err: puppet facts find takes 1 argument, but you gave 0/
    @logs.first.to_s.should =~ /puppet facts find takes 1 argument, but you gave 0/
  end

  it "should return facts if a key is given to find", :'fails_on_ruby_1.9.2' => true do
    Puppet::Node::Facts.indirection.reset_terminus_class
    subject.command_line.stubs(:args).returns %w{find whatever --render-as yaml}

    expect {
      expect { subject.run }.to exit_with 0
    }.should have_printed(/object:Puppet::Node::Facts/)

    @logs.should be_empty
  end
end

Version data entries

25 entries across 25 versions & 3 rubygems

Version Path
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/puppet-2.7.18/spec/unit/application/facts_spec.rb
supply_drop-0.11.0 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/application/facts_spec.rb
librarian-puppet-0.9.3 vendor/gems/ruby/1.8/gems/puppet-2.7.18/spec/unit/application/facts_spec.rb
supply_drop-0.10.2 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/application/facts_spec.rb
puppet-2.7.18 spec/unit/application/facts_spec.rb
supply_drop-0.10.1 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/application/facts_spec.rb
supply_drop-0.10.0 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/application/facts_spec.rb
puppet-2.7.17 spec/unit/application/facts_spec.rb
puppet-2.7.16 spec/unit/application/facts_spec.rb
puppet-2.7.14 spec/unit/application/facts_spec.rb
puppet-2.7.13 spec/unit/application/facts_spec.rb
supply_drop-0.9.0 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/application/facts_spec.rb
supply_drop-0.8.1 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/application/facts_spec.rb
supply_drop-0.8.0 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/application/facts_spec.rb
puppet-2.7.12 spec/unit/application/facts_spec.rb
puppet-2.7.11 spec/unit/application/facts_spec.rb
supply_drop-0.7.0 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/application/facts_spec.rb
supply_drop-0.6.1 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/application/facts_spec.rb
supply_drop-0.6.0 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/application/facts_spec.rb
puppet-2.7.9 spec/unit/application/facts_spec.rb