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

Version Path
puppet-2.6.18 test/ral/type/mailalias.rb
puppet-2.6.17 test/ral/type/mailalias.rb
puppet-2.6.16 test/ral/type/mailalias.rb
puppet-2.6.15 test/ral/type/mailalias.rb
puppet-2.6.14 test/ral/type/mailalias.rb
puppet-2.6.13 test/ral/type/mailalias.rb
puppet-2.6.12 test/ral/type/mailalias.rb
puppet-2.6.11 test/ral/type/mailalias.rb
puppet-2.6.10 test/ral/type/mailalias.rb
puppet-2.6.9 test/ral/type/mailalias.rb
puppet-2.6.8 test/ral/type/mailalias.rb
puppet-2.6.7 test/ral/type/mailalias.rb
puppet-2.6.6 test/ral/type/mailalias.rb
puppet-2.6.5 test/ral/type/mailalias.rb
puppet-2.6.4 test/ral/type/mailalias.rb
puppet-2.6.3 test/ral/type/mailalias.rb
puppet-2.6.2 test/ral/type/mailalias.rb
puppet-2.6.1 test/ral/type/mailalias.rb
puppet-2.6.0 test/ral/type/mailalias.rb