module Rails::Generators::Testing::Behaviour

def create_generated_attribute(attribute_type, name = "test", index = nil)

create_generated_attribute(:string, "name")

attribute type and, optionally, the attribute name:
Create a Rails::Generators::GeneratedAttribute by supplying the
def create_generated_attribute(attribute_type, name = "test", index = nil)
  Rails::Generators::GeneratedAttribute.parse([name, attribute_type, index].compact.join(":"))
end