Sha256: 02848bd3d5ce0715aeeb81c4e2de88cc8070246a385e30225f9398d4a2f1cf1c
Contents?: true
Size: 1.15 KB
Versions: 19
Compression:
Stored size: 1.15 KB
Contents
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../../lib/puppettest' require 'puppettest' require 'mocha' class TestMailAlias < Test::Unit::TestCase include PuppetTest def setup super @type = Puppet::Type.type(:mailalias) @provider = @type.defaultprovider # Make sure they are using the parsed provider unless @provider.name == :aliases @type.defaultprovider = @type.provider(:aliases) end cleanup do @type.defaultprovider = nil end if @provider.respond_to?(:default_target=) @default_file = @provider.default_target cleanup do @provider.default_target = @default_file end @target = tempfile @provider.default_target = @target end end # This isn't much of a test, but then, it's not much of a type. def test_recipient_arrays resource = @type.new(:name => "luke", :recipient => "yay", :target => tempfile) values = resource.retrieve_resource assert_equal(:absent, values[:recipient]) resource.property(:recipient).expects(:set).with(%w{yay}) assert_nothing_raised("Could not sync mailalias") do resource.property(:recipient).sync end end end
Version data entries
19 entries across 19 versions & 1 rubygems