mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
Improved test coverage for argument errors on callbacks
This commit is contained in:
parent
192d8e41e4
commit
913e1094d5
1 changed files with 9 additions and 1 deletions
|
@ -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
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue