Sha256: 57d7f222f47aa2f4d123a33f49d9e84ab65d10c53635cefcf150f03f3ba97ec2

Contents?: true

Size: 1.17 KB

Versions: 4

Compression:

Stored size: 1.17 KB

Contents

#!/usr/bin/env ruby

require File.dirname(__FILE__) + '/../../../lib/puppettest'

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
puppet-0.24.0 test/ral/providers/mailalias/aliases.rb
puppet-0.24.2 test/ral/providers/mailalias/aliases.rb
puppet-0.24.1 test/ral/providers/mailalias/aliases.rb
puppet-0.24.3 test/ral/providers/mailalias/aliases.rb