Sha256: d036f723db85cb66f9cb78f68e01b7a0af0515e8c25ea2fcb16631645c299fe1

Contents?: true

Size: 1.08 KB

Versions: 33

Compression:

Stored size: 1.08 KB

Contents

#!/usr/bin/env rspec
require 'spec_helper'
require 'puppet/application/secret_agent'
require 'puppet/indirector/catalog/rest'
require 'puppet/indirector/report/rest'
require 'tempfile'

describe "Puppet::Application::Secret_agent" do
  include PuppetSpec::Files

  it "should retrieve and apply a catalog and submit a report" do
    pending "REVISIT: 2.7 changes broke this, and we want the merge published"

    dirname = tmpdir("puppetdir")
    Puppet[:vardir]   = dirname
    Puppet[:confdir]  = dirname
    Puppet[:certname] = "foo"
    @catalog = Puppet::Resource::Catalog.new
    @file = Puppet::Resource.new(:file, File.join(dirname, "tmp_dir_resource"), :parameters => {:ensure => :present})
    @catalog.add_resource(@file)

    @report = Puppet::Transaction::Report.new("apply")
    Puppet::Transaction::Report.stubs(:new).returns(@report)

    Puppet::Resource::Catalog::Rest.any_instance.stubs(:find).returns(@catalog)
    @report.expects(:save)

    Puppet::Util::Log.stubs(:newdestination)

    Puppet::Application::Secret_agent.new.run

    @report.status.should == "changed"
  end
end

Version data entries

33 entries across 33 versions & 3 rubygems

Version Path
puppet-2.7.26 spec/unit/application/secret_agent_spec.rb
puppet-2.7.25 spec/unit/application/secret_agent_spec.rb
puppet-2.7.24 spec/unit/application/secret_agent_spec.rb
puppet-2.7.23 spec/unit/application/secret_agent_spec.rb
puppet-2.7.22 spec/unit/application/secret_agent_spec.rb
puppet-2.7.21 spec/unit/application/secret_agent_spec.rb
puppet-2.7.20 spec/unit/application/secret_agent_spec.rb
puppet-2.7.20.rc1 spec/unit/application/secret_agent_spec.rb
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/puppet-2.7.18/spec/unit/application/secret_agent_spec.rb
puppet-2.7.19 spec/unit/application/secret_agent_spec.rb
supply_drop-0.11.0 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/application/secret_agent_spec.rb
librarian-puppet-0.9.3 vendor/gems/ruby/1.8/gems/puppet-2.7.18/spec/unit/application/secret_agent_spec.rb
supply_drop-0.10.2 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/application/secret_agent_spec.rb
puppet-2.7.18 spec/unit/application/secret_agent_spec.rb
supply_drop-0.10.1 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/application/secret_agent_spec.rb
supply_drop-0.10.0 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/application/secret_agent_spec.rb
puppet-2.7.17 spec/unit/application/secret_agent_spec.rb
puppet-2.7.16 spec/unit/application/secret_agent_spec.rb
puppet-2.7.14 spec/unit/application/secret_agent_spec.rb
puppet-2.7.13 spec/unit/application/secret_agent_spec.rb