spec/ventable/ventable_spec.rb in ventable-0.0.2 vs spec/ventable/ventable_spec.rb in ventable-0.0.3

- old
+ new

@@ -126,16 +126,24 @@ end class SomeOtherStuffHappened include Ventable::Event end + class ClassWithCustomCallbackMethodEvent + include Ventable::Event + + def self.ventable_callback_method_name + :handle_my_special_event + end + end end it "should properly set the callback method name" do SomeAwesomeEvent.default_callback_method.should == :handle_some_awesome_event - Blah::AnotherSweetEvent.default_callback_method.should == :handle_another_sweet_event + Blah::AnotherSweetEvent.default_callback_method.should == :handle_blah__another_sweet_event SomeOtherStuffHappened.default_callback_method.should == :handle_some_other_stuff_happened_event + ClassWithCustomCallbackMethodEvent.default_callback_method.should == :handle_my_special_event end end describe "#configure" do it "properly configures the event with observesrs" do @@ -162,8 +170,21 @@ end end TestEvent.new.fire! notified_observer.should be_true called_transaction.should be_true + end + + it "throws exception if :inside references unknown group" do + begin + TestEvent.configure do + notifies inside: :transaction do + # some stuff + end + end + fail "Shouldn't reach here, must throw a valid exception" + rescue Exception => e + e.class.should == Ventable::Error + end end end end