Sha256: bf1169bc3a7d08f6df6c2a9a9da7b2884adad95641acd60c3fee1dc24683eea3
Contents?: true
Size: 1.99 KB
Versions: 24
Compression:
Stored size: 1.99 KB
Contents
require File.join(File.dirname(__FILE__), '..', 'lib', 'flapjack', 'applications', 'notifier') require File.join(File.dirname(__FILE__), '..', 'lib', 'flapjack', 'transports', 'result') require File.join(File.dirname(__FILE__), 'helpers') describe "running the notifier" do before(:all) do @options = { :notifiers => {:testmailer => {}}, :notifier_directories => [File.join(File.dirname(__FILE__),'notifier-directories', 'spoons')], :recipients => [{:name => "Spoons McDoom"}], :transport => {:backend => :mock_transport, :basedir => File.join(File.dirname(__FILE__), 'transports')}, :persistence => {:backend => :mock_persistence_backend, :basedir => File.join(File.dirname(__FILE__), 'persistence')}, :filter_directories => [File.join(File.dirname(__FILE__),'test-filters')] } end it "should notify by default" do @options[:filters] = [] @options[:log] = MockLogger.new app = Flapjack::Notifier::Application.run(@options) # processes a MockResult, as defined in spec/transports/mock_transport.rb app.process_result app.log.messages.find {|m| m =~ /testmailer notifying/i}.should be_true end it "should not notify if any filters fail" do @options[:filters] = ['blocker'] @options[:log] = MockLogger.new app = Flapjack::Notifier::Application.run(@options) # processes a MockResult, as defined in spec/transports/mock_transport.rb app.process_result app.log.messages.find {|m| m =~ /testmailer notifying/i}.should be_nil end it "should notify if all filters pass" do @options[:filters] = ['mock'] @options[:log] = MockLogger.new app = Flapjack::Notifier::Application.run(@options) # processes a MockResult, as defined in spec/transports/mock_transport.rb app.process_result app.log.messages.find {|m| m =~ /testmailer notifying/i}.should be_true end end
Version data entries
24 entries across 24 versions & 1 rubygems