Make config.generators accept string namespaces, you can do now config.generators.test_framework 'rspec' for instance
Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
parent
79d6f314c6
commit
e107c208f0
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user