Sha256: a93e3d99536fb8630f7c367df8eb44a8ad60cbc9f6706a7905d384b60f47186c

Contents?: true

Size: 585 Bytes

Versions: 9

Compression:

Stored size: 585 Bytes

Contents

#!/usr/bin/env rspec
require 'spec_helper'

require 'puppet/indirector/facts/inventory_service'

describe Puppet::Node::Facts::InventoryService do
  it "should suppress failures and warn when saving facts" do
    facts = Puppet::Node::Facts.new('foo')
    request = Puppet::Indirector::Request.new(:facts, :save, facts)

    Net::HTTP.any_instance.stubs(:put).raises(Errno::ECONNREFUSED)

    Puppet.expects(:warning).with do |msg|
      msg =~ /Could not upload facts for foo to inventory service/
    end

    expect {
      subject.save(request)
    }.to_not raise_error
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
puppet-2.7.26 spec/unit/indirector/facts/inventory_service_spec.rb
puppet-2.7.25 spec/unit/indirector/facts/inventory_service_spec.rb
puppet-2.7.24 spec/unit/indirector/facts/inventory_service_spec.rb
puppet-2.7.23 spec/unit/indirector/facts/inventory_service_spec.rb
puppet-2.7.22 spec/unit/indirector/facts/inventory_service_spec.rb
puppet-2.7.21 spec/unit/indirector/facts/inventory_service_spec.rb
puppet-2.7.20 spec/unit/indirector/facts/inventory_service_spec.rb
puppet-2.7.20.rc1 spec/unit/indirector/facts/inventory_service_spec.rb
puppet-2.7.19 spec/unit/indirector/facts/inventory_service_spec.rb