Sha256: a16b35be6d7798232de441ea210de58c48f91e59320c8f825c4ff2d301293dcb
Contents?: true
Size: 959 Bytes
Versions: 36
Compression:
Stored size: 959 Bytes
Contents
require 'spec_helper' describe "the 'tag' function" do before :all do Puppet::Parser::Functions.autoloader.loadall end before :each do node = Puppet::Node.new('localhost') compiler = Puppet::Parser::Compiler.new(node) @scope = Puppet::Parser::Scope.new(compiler) end it "should exist" do expect(Puppet::Parser::Functions.function(:tag)).to eq("function_tag") end it "should tag the resource with any provided tags" do resource = Puppet::Parser::Resource.new(:file, "/file", :scope => @scope) expect(@scope).to receive(:resource).and_return(resource) @scope.function_tag ["one", "two"] expect(resource).to be_tagged("one") expect(resource).to be_tagged("two") end it 'is not available when --tasks is on' do Puppet[:tasks] = true expect do @scope.function_tag(['one', 'two']) end.to raise_error(Puppet::ParseError, /is only available when compiling a catalog/) end end
Version data entries
36 entries across 36 versions & 1 rubygems