提交 e107c208 编写于 作者: S Santiago Pastorino 提交者: José Valim

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

Make config.generators accept string namespaces, you can do now config.generators.test_framework 'rspec' for instance
Signed-off-by: NJosé Valim <jose.valim@gmail.com>
上级 79d6f314
......@@ -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
......
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册