File: mailalias_spec.rb

package info (click to toggle)
puppet 3.7.2-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 18,896 kB
  • sloc: ruby: 210,387; sh: 2,050; xml: 1,554; lisp: 300; makefile: 142; python: 108; sql: 103; yacc: 72
file content (21 lines) | stat: -rwxr-xr-x 606 bytes parent folder | download | duplicates (3)
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