module Ammeter::RSpec::Rails::GeneratorExampleGroup

Delegates to Rails::Generators::TestCase to work with RSpec.

Constants

DELEGATED_METHODS

Public Instance Methods

file(relative) click to toggle source
# File lib/ammeter/rspec/generator/example/generator_example_group.rb, line 76
def file relative
  File.expand_path(relative, destination_root)
end
invoke_task(name) click to toggle source
# File lib/ammeter/rspec/generator/example/generator_example_group.rb, line 49
def invoke_task name
  OutputCapturer.capture(:stdout) { generator.invoke_task(generator_class.all_tasks[name.to_s]) }
end
migration_file(relative) click to toggle source
# File lib/ammeter/rspec/generator/example/generator_example_group.rb, line 79
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
prepare_destination() click to toggle source
# File lib/ammeter/rspec/generator/example/generator_example_group.rb, line 59
def prepare_destination
  self.class.send :prepare_destination
end
subject() click to toggle source
# File lib/ammeter/rspec/generator/example/generator_example_group.rb, line 85
def subject
  generator
end