Sha256: 62f35ecc249c7699884804771d170bad7b443fe08e68682fb442c4d661abea89

Contents?: true

Size: 1.21 KB

Versions: 2

Compression:

Stored size: 1.21 KB

Contents

#!/usr/bin/env ruby

$:.unshift("../../../lib") if __FILE__ =~ /\.rb$/

require 'puppettest'
require 'puppettest/fileparsing'
require 'puppet/type/mailalias'

class TestMailaliasAliasesProvider < Test::Unit::TestCase
	include PuppetTest
	include PuppetTest::FileParsing

    def setup
        super
        @provider = Puppet.type(:mailalias).provider(:aliases)

        @oldfiletype = @provider.filetype

        @alias = mkalias
    end

    def teardown
        Puppet::Util::FileType.filetype(:ram).clear
        @provider.filetype = @oldfiletype
        @provider.clear
        super
    end
    
    def mkalias(name = "me")
        if defined? @pcount
            @pcount += 1
        else
            @pcount = 1
        end
        args = {
            :name => name,
            :recipient => %w{here there}
        }

        fakeresource = fakeresource(:mailalias, args[:name])

        key = @provider.new(fakeresource)
        args.each do |p,v|
            key.send(p.to_s + "=", v)
        end

        return key
    end

    def test_data_parsing_and_generating
        fakedata("data/types/mailalias").each { |file|
            fakedataparse(file)
        }
    end
end

# $Id: aliases.rb 2676 2007-07-10 23:24:34Z luke $

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
puppet-0.23.2 test/ral/providers/mailalias/aliases.rb
puppet-0.23.1 test/ral/providers/mailalias/aliases.rb