<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,8 @@
+== (unreleased)
+
+* Make sure role(:foo) actually declares an (empty) role for :foo, even without server arguments [Jamis Buck]
+
+
 == 2.5.4 / 4 Feb 2009
 
 * When using rsync with the remote_cache strategy include -t switch to preserve file times [Kevin McCarthy]</diff>
      <filename>CHANGELOG.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -45,6 +45,14 @@ module Capistrano
       def role(which, *args, &amp;block)
         options = args.last.is_a?(Hash) ? args.pop : {}
         which = which.to_sym
+
+        # The roles Hash is defined so that unrecognized keys always auto-initialize
+        # to a new Role instance (see the assignment in the initialize_with_roles method,
+        # above). However, we explicitly assign here so that role declarations will
+        # vivify the role object even if there are no server arguments. (Otherwise,
+        # role(:app) won't actually instantiate a Role object for :app.)
+        roles[which] ||= Role.new
+
         roles[which].push(block, options) if block_given?
         args.each { |host| roles[which] &lt;&lt; ServerDefinition.new(host, options) }
       end</diff>
      <filename>lib/capistrano/configuration/roles.rb</filename>
    </modified>
    <modified>
      <diff>@@ -24,6 +24,7 @@ class ConfigurationRolesTest &lt; Test::Unit::TestCase
 
   def test_role_should_allow_empty_list
     @config.role :app
+    assert @config.roles.keys.include?(:app)
     assert @config.roles[:app].empty?
   end
 </diff>
      <filename>test/configuration/roles_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>42ff8b9e7dd9ec1c1de59b8f7dc0c0461cc2741b</id>
    </parent>
  </parents>
  <author>
    <name>Jamis Buck</name>
    <email>jamis@37signals.com</email>
  </author>
  <url>http://github.com/jamis/capistrano/commit/2ce539d87c928f41d82f7bfda84e228d3948d82b</url>
  <id>2ce539d87c928f41d82f7bfda84e228d3948d82b</id>
  <committed-date>2009-02-13T19:05:25-08:00</committed-date>
  <authored-date>2009-02-13T19:05:25-08:00</authored-date>
  <message>Make sure role() can declare roles without servers</message>
  <tree>7b5964513a8a02c39f1dfd2216ec8b053926007a</tree>
  <committer>
    <name>Jamis Buck</name>
    <email>jamis@37signals.com</email>
  </committer>
</commit>
