module Ammeter::RSpec::Rails::GeneratorExampleGroup

def file relative

def file relative
  Pathname.new(File.expand_path(relative, destination_root))
end

def invoke_task name

def invoke_task name
  OutputCapturer.capture(:stdout) { generator.invoke_task(generator_class.all_tasks[name.to_s]) }
end

def migration_file relative

def migration_file relative
  file_path = file(relative)
  migration_file = Dir.glob("#{File.dirname(file_path)}/[0-9]*_#{File.basename(file_path)}").first
  migration_file = "#{File.dirname(file_path)}/TIMESTAMP_#{File.basename(file_path)}" if migration_file.nil?
  migration_file
end

def prepare_destination

def prepare_destination
  self.class.send :prepare_destination
end

def subject

def subject
  generator
end