spec/ventable/ventable_spec.rb in ventable-0.0.4 vs spec/ventable/ventable_spec.rb in ventable-0.0.5

- old
+ new

@@ -105,11 +105,13 @@ TestEvent.new.fire! transaction_called.should be_true observer_block_called.should be_true + transaction_called.should be_true transaction_already_completed.should be_false + event_inside.should_not be_nil event_inside.should be_a(TestEvent) end end @@ -178,9 +180,19 @@ 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 + it "throws exception if nil observer added to the list" do + begin + TestEvent.configure do + notifies nil end fail "Shouldn't reach here, must throw a valid exception" rescue Exception => e e.class.should == Ventable::Error end