Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make config.generators accept string namespaces, you can do now confi…

…g.generators.test_framework 'rspec' for instance

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
commit e107c208f0422b83df473666e30256f837c263eb 1 parent 79d6f31
Santiago Pastorino spastorino authored josevalim committed
1  railties/lib/rails/configuration.rb
View
@@ -60,6 +60,7 @@ def method_missing(method, *args)
namespace, configuration = method, args.shift
else
namespace, configuration = args.shift, args.shift
+ namespace = namespace.to_sym if namespace.respond_to?(:to_sym)
@options[:rails][method] = namespace
end
15 railties/test/application/generators_test.rb
View
@@ -103,5 +103,20 @@ def with_bare_config
assert_equal({ :plugin => { :generator => "-g" } }, c.generators.aliases)
end
end
+
+ test "generators with string and hash for options should generate symbol keys" do
+ with_bare_config do |c|
+ c.generators do |g|
+ g.orm 'datamapper', :migration => false
+ end
+
+ expected = {
+ :rails => { :orm => :datamapper },
+ :datamapper => { :migration => false }
+ }
+
+ assert_equal expected, c.generators.options
+ end
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.