fujin / puppet forked from lak/puppet

Server automation framework and application

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