Sha256: 85dd9a6d91c67c23d426487be25d590fe5cc7d777500875b84872321daf9431f
Contents?: true
Size: 1.52 KB
Versions: 172
Compression:
Stored size: 1.52 KB
Contents
require 'spec_helper' require 'puppet/face' require 'puppet/file_serving/metadata' require 'puppet/file_serving/content' require 'puppet/indirector/memory' module PuppetFaceIntegrationSpecs describe "Puppet plugin face" do INDIRECTORS = [ Puppet::Indirector::FileMetadata, Puppet::Indirector::FileContent, ] INDIRECTED_CLASSES = [ Puppet::FileServing::Metadata, Puppet::FileServing::Content, Puppet::Node::Facts, ] INDIRECTORS.each do |indirector| class indirector::Memory < Puppet::Indirector::Memory def find(request) model.new('/dev/null', { 'type' => 'directory' }) end end end before do FileUtils.mkdir(File.join(Puppet[:vardir], 'lib')) FileUtils.mkdir(File.join(Puppet[:vardir], 'facts.d')) @termini_classes = {} INDIRECTED_CLASSES.each do |indirected| @termini_classes[indirected] = indirected.indirection.terminus_class indirected.indirection.terminus_class = :memory end end after do INDIRECTED_CLASSES.each do |indirected| indirected.indirection.terminus_class = @termini_classes[indirected] indirected.indirection.termini.clear end end def init_cli_args_and_apply_app(args = ["download"]) Puppet::Application.find(:plugin).new(stub('command_line', :subcommand_name => :plugin, :args => args)) end it "processes a download request" do app = init_cli_args_and_apply_app expect do expect { app.run }.to exit_with(0) end.to have_printed(/No plugins downloaded/) end end end
Version data entries
172 entries across 172 versions & 1 rubygems