Sha256: 1adcd3c523815068cfce8e59752c3d028a87bbad39cb88f896cc72379fecdb45

Contents?: true

Size: 1.08 KB

Versions: 92

Compression:

Stored size: 1.08 KB

Contents

#! /usr/bin/env ruby
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

92 entries across 92 versions & 2 rubygems

Version Path
puppet-3.8.7 spec/unit/application/secret_agent_spec.rb
puppet-3.8.7-x86-mingw32 spec/unit/application/secret_agent_spec.rb
puppet-3.8.7-x64-mingw32 spec/unit/application/secret_agent_spec.rb
puppet-3.8.6 spec/unit/application/secret_agent_spec.rb
puppet-3.8.6-x86-mingw32 spec/unit/application/secret_agent_spec.rb
puppet-3.8.6-x64-mingw32 spec/unit/application/secret_agent_spec.rb
puppet-3.8.5 spec/unit/application/secret_agent_spec.rb
puppet-3.8.5-x86-mingw32 spec/unit/application/secret_agent_spec.rb
puppet-3.8.5-x64-mingw32 spec/unit/application/secret_agent_spec.rb
puppet-3.8.4 spec/unit/application/secret_agent_spec.rb
puppet-3.8.4-x86-mingw32 spec/unit/application/secret_agent_spec.rb
puppet-3.8.4-x64-mingw32 spec/unit/application/secret_agent_spec.rb
puppet-3.8.3 spec/unit/application/secret_agent_spec.rb
puppet-3.8.3-x86-mingw32 spec/unit/application/secret_agent_spec.rb
puppet-3.8.3-x64-mingw32 spec/unit/application/secret_agent_spec.rb
puppet-3.8.2 spec/unit/application/secret_agent_spec.rb
puppet-3.8.2-x86-mingw32 spec/unit/application/secret_agent_spec.rb
puppet-3.8.2-x64-mingw32 spec/unit/application/secret_agent_spec.rb
puppet-3.8.1 spec/unit/application/secret_agent_spec.rb
puppet-3.8.1-x86-mingw32 spec/unit/application/secret_agent_spec.rb