1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00

Ticket #193 - alias_task preserve on_error

This commit is contained in:
Rafa García 2011-05-08 18:44:37 +02:00
parent e300d810f2
commit dd4fd68d8e
2 changed files with 11 additions and 0 deletions

View file

@ -14,6 +14,7 @@ module Capistrano
options = {} options = {}
options[:desc] = task.description options[:desc] = task.description
options[:on_error] = task.on_error
task(new_name, options, &task.body) task(new_name, options, &task.body)
end end

View file

@ -47,6 +47,16 @@ class AliasTaskTest < Test::Unit::TestCase
assert_equal task.description, new_task.description assert_equal task.description, new_task.description
end end
def test_aliased_task_should_preserve_on_error
@config.task(:foo, :on_error => :continue) { 42 }
@config.alias_task 'new_foo', 'foo'
task = @config.find_task('foo')
new_task = @config.find_task('new_foo')
assert_equal task.on_error, new_task.on_error
end
def test_raise_exception_when_task_doesnt_exist def test_raise_exception_when_task_doesnt_exist
assert_raises(Capistrano::NoSuchTaskError) { @config.alias_task 'non_existant_task', 'fail_miserably' } assert_raises(Capistrano::NoSuchTaskError) { @config.alias_task 'non_existant_task', 'fail_miserably' }
end end