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

Defined in:
lib/rails/generators/testing/behavior.rb

Instance Method Summary collapse

Instance Method Details

#arguments(array) ⇒ Object

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

arguments %w(app_name --skip-active-record)


36
37
38
# File 'lib/rails/generators/testing/behavior.rb', line 36

def arguments(array)
  self.default_arguments = array
end

#destination(path) ⇒ Object

Sets the destination of generator files:

destination File.expand_path("../tmp", __dir__)


43
44
45
# File 'lib/rails/generators/testing/behavior.rb', line 43

def destination(path)
  self.destination_root = path
end

#tests(klass) ⇒ Object

Sets which generator should be tested:

tests AppGenerator


28
29
30
# File 'lib/rails/generators/testing/behavior.rb', line 28

def tests(klass)
  self.generator_class = klass
end