Sha256: d1f89e58b5af372657cc1945bf4d4d247720ab36d88d023702c117600829ddb5
Contents?: true
Size: 883 Bytes
Versions: 17
Compression:
Stored size: 883 Bytes
Contents
#! /usr/bin/env ruby 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 /Error: 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" 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 }.to have_printed(/object:Puppet::Node::Facts/) @logs.should be_empty end end
Version data entries
17 entries across 17 versions & 2 rubygems