Skip to content

Commit

Permalink
Ticket capistrano#193 - alias_task preserve max_hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
rgo committed Nov 5, 2011
1 parent dd4fd68 commit d223b32
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/capistrano/configuration/alias_task.rb
Expand Up @@ -15,6 +15,7 @@ def alias_task(new_name, old_name)
options = {}
options[:desc] = task.description
options[:on_error] = task.on_error
options[:max_hosts] = task.max_hosts

task(new_name, options, &task.body)
end
Expand Down
10 changes: 10 additions & 0 deletions test/configuration/alias_task_test.rb
Expand Up @@ -57,6 +57,16 @@ def test_aliased_task_should_preserve_on_error
assert_equal task.on_error, new_task.on_error
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
assert_raises(Capistrano::NoSuchTaskError) { @config.alias_task 'non_existant_task', 'fail_miserably' }
end
Expand Down

0 comments on commit d223b32

Please sign in to comment.