123456789_123456789_123456789_123456789_123456789_

Module: Rails::Generators::Testing::Behavior::ClassMethods

Relationships & Source Files
Defined in: railties/lib/rails/generators/testing/behavior.rb

Instance Method Summary

Instance Method Details

#arguments(array)

Sets default arguments on generator invocation. This can be overwritten when invoking it.

arguments %w(app_name --skip-active-record)
[ GitHub ]

  
# File 'railties/lib/rails/generators/testing/behavior.rb', line 39

def arguments(array)
  self.default_arguments = array
end

#destination(path)

Sets the destination of generator files:

destination File.expand_path("../tmp", __dir__)
[ GitHub ]

  
# File 'railties/lib/rails/generators/testing/behavior.rb', line 46

def destination(path)
  self.destination_root = path
end

#tests(klass)

Sets which generator should be tested:

tests AppGenerator
[ GitHub ]

  
# File 'railties/lib/rails/generators/testing/behavior.rb', line 31

def tests(klass)
  self.generator_class = klass
end