Sha256: 0d51ccf1aa56a2c9568e849b3bd0891512e13e6e9f3c3abc987e7f721ca915c8

Contents?: true

Size: 741 Bytes

Versions: 194

Compression:

Stored size: 741 Bytes

Contents

#! /usr/bin/env ruby
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)
    @scope.expects(:resource).returns resource

    @scope.function_tag ["one", "two"]

    expect(resource).to be_tagged("one")
    expect(resource).to be_tagged("two")
  end
end

Version data entries

194 entries across 194 versions & 1 rubygems

Version Path
puppet-5.3.7 spec/unit/parser/functions/tag_spec.rb
puppet-5.3.7-x86-mingw32 spec/unit/parser/functions/tag_spec.rb
puppet-5.3.7-x64-mingw32 spec/unit/parser/functions/tag_spec.rb
puppet-5.3.7-universal-darwin spec/unit/parser/functions/tag_spec.rb
puppet-4.10.12 spec/unit/parser/functions/tag_spec.rb
puppet-4.10.12-x86-mingw32 spec/unit/parser/functions/tag_spec.rb
puppet-4.10.12-x64-mingw32 spec/unit/parser/functions/tag_spec.rb
puppet-4.10.12-universal-darwin spec/unit/parser/functions/tag_spec.rb
puppet-4.10.11 spec/unit/parser/functions/tag_spec.rb
puppet-4.10.11-x86-mingw32 spec/unit/parser/functions/tag_spec.rb
puppet-4.10.11-x64-mingw32 spec/unit/parser/functions/tag_spec.rb
puppet-4.10.11-universal-darwin spec/unit/parser/functions/tag_spec.rb
puppet-5.3.6 spec/unit/parser/functions/tag_spec.rb
puppet-5.3.6-x86-mingw32 spec/unit/parser/functions/tag_spec.rb
puppet-5.3.6-x64-mingw32 spec/unit/parser/functions/tag_spec.rb
puppet-5.3.6-universal-darwin spec/unit/parser/functions/tag_spec.rb
puppet-5.3.5 spec/unit/parser/functions/tag_spec.rb
puppet-5.3.5-x86-mingw32 spec/unit/parser/functions/tag_spec.rb
puppet-5.3.5-x64-mingw32 spec/unit/parser/functions/tag_spec.rb
puppet-5.3.5-universal-darwin spec/unit/parser/functions/tag_spec.rb