public
Fork of lak/puppet
Description: Server automation framework and application
Homepage: http://reductivelabs.com/trac/puppet/
Clone URL: git://github.com/fujin/puppet.git
puppet / spec / unit / reports / tagmail.rb
100755 54 lines (39 sloc) 1.239 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env ruby
 
require File.dirname(__FILE__) + '/../../spec_helper'
 
require 'puppet/reports'
 
describe Puppet::Reports, " when generating a tagmail template " do
  before(:each) do
    @report_module = Puppet::Reports.report(:tagmail)
    @processor = Object.new.extend(@report_module)
  end
 
  it "should have a process method" do
    @processor.should respond_to(:process)
  end
 
  it "should have a match method" do
    @processor.should respond_to(:match)
  end
 
  it "should have a parse method" do
    @processor.should respond_to(:parse)
  end
 
  it "should have a generate_email method" do
    @processor.should respond_to(:generate_email)
  end
 
  it "should have a send method" do
    @processor.should respond_to(:send)
  end
 
  it "should use logs" do
    @log = mock 'log'
 
    @log.stubs(:level).returns :notice
    @log.stubs(:message).returns "false message"
    @log.stubs(:tags).returns "test"
 
    #@processor.expects(:logs).returns [@log]
    @processor.process
  end
 
  it "should fail when we actually process logs" do
    @processor.process
  end
 
  it "should load template from file when template file exists" do
  end
 
  it "should use a default template when tagmailtemplate does not exist" do
  end
end