spec/module_spec.rb in mole-1.0.5 vs spec/module_spec.rb in mole-1.0.6
- old
+ new
@@ -7,43 +7,43 @@
require File.join( File.dirname(__FILE__), %w[data blee] )
end
before( :each ) do
@blee = Blee.new
- CallStackChecker.reset
+ CallStackChecker.reset!
end
it "should trap mole before handler exceptions" do
Blee.mole_before( :feature => :crap_out ) { |context, feature, *args|
- raise "Before - Something did crap out"
+ raise "LEGIT !! - Before - Something did crap out"
CallStackChecker.called
}
@blee.crap_out
CallStackChecker.should_not be_called
end
it "should trap mole after handler exceptions" do
Blee.mole_after( :feature => :crap_out ) { |context, feature, *args|
- raise "After - Something did crap out"
+ raise "LEGIT !! - After - Something did crap out"
CallStackChecker.called
}
@blee.crap_out
CallStackChecker.should_not be_called
end
it "should trap mole handler exceptions" do
Blee.mole_unchecked( :features => [:blee_raise_too] ) { |context, feature, *args|
- raise "Unchecked - Something did crap out"
+ raise "-- LEGIT !! - Unchecked - Something did crap out"
CallStackChecker.called
}
@blee.blee_raise_too rescue nil
CallStackChecker.should_not be_called
end
it "should trap a perf handler exception" do
Blee.mole_perf( :features => [:blee_slow_too] ) do |context, feature, elapsed_time, args, block|
- raise "Perf - Something did crap out"
+ raise "---LEGIT !! - Perf - Something did crap out"
CallStackChecker.called
end
@blee.blee_slow_too
CallStackChecker.should_not be_called
end
@@ -122,11 +122,11 @@
args[1].should == "World"
args[2].should == "Good"
args[3].should == "Day"
CallStackChecker.called
end
- @blee.blee_block( "Hello", "World", "Good", "Day" ) { "Do it already!!" } rescue nil
+ @blee.blee_block( "Hello", "World", "Good", "Day" ) { "Do it already!!" }
CallStackChecker.should be_called
end
it "should correctly trap the after call with many arguments" do
Blee.mole_after( :feature => :blee_args ) { |context, feature, ret_val, block, *args|
@@ -156,11 +156,11 @@
args[1].should == "World"
args[2].should == "Good"
args[3].should == "Day"
CallStackChecker.called
end
- @blee.blee_block( "Hello", "World", "Good", "Day" ) { "Do it already!!" } rescue nil
+ @blee.blee_block( "Hello", "World", "Good", "Day" ) { "Do it already!!" }
CallStackChecker.should be_called
end
it "should correctly trap a slow call" do
Blee.mole_perf( :features => [:blee_slow] ) do |context, feature, elapsed_time, ret_val, block, *args|
@@ -170,10 +170,10 @@
block.should be_nil
args.size.should == 0
elapsed_time.should > 1
CallStackChecker.called
end
- @blee.blee_slow rescue nil
+ @blee.blee_slow
CallStackChecker.should be_called
end
it "should trap a private method correctly" do
Blee.mole_after( :feature => :blee_private ) { |context, feature, ret_val, block, *args|
\ No newline at end of file