From 913e1094d5b25739a7e6d54fa9707024706cd2d4 Mon Sep 17 00:00:00 2001 From: Ryan McGeary Date: Sat, 10 May 2008 19:08:36 -0400 Subject: [PATCH] Improved test coverage for argument errors on callbacks --- test/configuration/callbacks_test.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/configuration/callbacks_test.rb b/test/configuration/callbacks_test.rb index 56ca47d3..808323c9 100644 --- a/test/configuration/callbacks_test.rb +++ b/test/configuration/callbacks_test.rb @@ -96,6 +96,14 @@ class ConfigurationCallbacksTest < Test::Unit::TestCase assert_equal 1, @config.callbacks[:before].length assert_equal %w(primary), @config.callbacks[:before].first.except end + + def test_on_without_tasks_or_block_should_raise_error + assert_raises(ArgumentError) { @config.on(:before) } + end + + def test_on_with_both_tasks_and_block_should_raise_error + assert_raises(ArgumentError) { @config.on(:before, :first) { blah } } + end def test_trigger_without_constraints_should_invoke_all_callbacks task = stub(:fully_qualified_name => "any:old:thing") @@ -203,4 +211,4 @@ class ConfigurationCallbacksTest < Test::Unit::TestCase @config.execute_task(task) end -end \ No newline at end of file +end