mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
Ticket #193 - alias_task preserve max_hosts
This commit is contained in:
parent
dd4fd68d8e
commit
d223b32cb5
2 changed files with 11 additions and 0 deletions
|
@ -15,6 +15,7 @@ module Capistrano
|
||||||
options = {}
|
options = {}
|
||||||
options[:desc] = task.description
|
options[:desc] = task.description
|
||||||
options[:on_error] = task.on_error
|
options[:on_error] = task.on_error
|
||||||
|
options[:max_hosts] = task.max_hosts
|
||||||
|
|
||||||
task(new_name, options, &task.body)
|
task(new_name, options, &task.body)
|
||||||
end
|
end
|
||||||
|
|
|
@ -57,6 +57,16 @@ class AliasTaskTest < Test::Unit::TestCase
|
||||||
assert_equal task.on_error, new_task.on_error
|
assert_equal task.on_error, new_task.on_error
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_aliased_task_should_preserve_max_hosts
|
||||||
|
@config.task(:foo, :max_hosts => 5) { 42 }
|
||||||
|
@config.alias_task 'new_foo', 'foo'
|
||||||
|
|
||||||
|
task = @config.find_task('foo')
|
||||||
|
new_task = @config.find_task('new_foo')
|
||||||
|
|
||||||
|
assert_equal task.max_hosts, new_task.max_hosts
|
||||||
|
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
|
||||||
|
|
Loading…
Add table
Reference in a new issue