Sha256: 83a8cc2d7badb562702fc29b42c40b7721b5508bf52ad259bc78880e07dd6cb1
Contents?: true
Size: 983 Bytes
Versions: 96
Compression:
Stored size: 983 Bytes
Contents
require 'spec_helper' class DummyNotificationPlugin < Killbill::Plugin::Notification end class HoarderNotificationPlugin < Killbill::Plugin::Notification attr_reader :events def start_plugin @events = [] super end def on_event(event) @events << event end def stop_plugin super @events = [] end end describe Killbill::Plugin::Notification do before(:each) do @event = Hash.new(:account_id => SecureRandom.uuid) end it "should not raise exceptions by default" do plugin = DummyNotificationPlugin.new lambda { plugin.on_event(@event) }.should_not raise_error end it "should be able to receive all events" do plugin = HoarderNotificationPlugin.new plugin.start_plugin plugin.events.size.should == 0 (1..100).each do |i| plugin.on_event(@event) plugin.events.size.should == i plugin.events[-1].should == @event end plugin.stop_plugin plugin.events.size.should == 0 end end
Version data entries
96 entries across 96 versions & 1 rubygems