lib/genspec/matchers/base.rb in genspec-0.3.1 vs lib/genspec/matchers/base.rb in genspec-0.3.2
- old
+ new
@@ -17,11 +17,11 @@
def match!
@matched = true
end
def matches?(generator)
- @described = generator[:described].to_s
+ @described = generator[:described]
base = nil
base, @described = @described.split(/:/) if @described =~ /:/
@args = generator[:args]
@generator_options = generator[:generator_options]
@shell = GenSpec::Shell.new(generator[:output] || "", generator[:input] || "")
@@ -29,12 +29,12 @@
if @described.kind_of?(Class)
@generator = @described
else
if GenSpec.rails?
- @generator = Rails::Generators.find_by_namespace(@described, base)
+ @generator = Rails::Generators.find_by_namespace(@described.to_s, base)
else
- @generator = Thor::Util.find_by_namespace(@described)
+ @generator = Thor::Util.find_by_namespace(@described.to_s)
end
end
raise "Could not find generator: #{@described.inspect}" unless @generator