summaryrefslogtreecommitdiff
path: root/spec/unit/type/mailalias_spec.rb
blob: 0ba60ce52383da4c1da1b2a4e8b973baedb4e901 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /usr/bin/env ruby
require 'spec_helper'

describe Puppet::Type.type(:mailalias) do
  include PuppetSpec::Files

  let :target do tmpfile('mailalias') end
  let :resource do
    described_class.new(:name => "luke", :recipient => "yay", :target => target)
  end

  it "should be initially absent" do
    resource.retrieve_resource[:recipient].should == :absent
  end

  it "should try and set the recipient when it does the sync" do
    resource.retrieve_resource[:recipient].should == :absent
    resource.property(:recipient).expects(:set).with(["yay"])
    resource.property(:recipient).sync
  end
end