Class: Hanami::Minitest::Commands::Generate::Action Private

Inherits:
CLI::Commands::App::Command
  • Object
show all
Defined in:
lib/hanami/minitest/commands.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 2.0.0

Instance Method Summary collapse

Instance Method Details

#call(options = nil, name: nil, slice: nil, skip_tests: false) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 2.0.0



109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/hanami/minitest/commands.rb', line 109

def call(options = nil, name: nil, slice: nil, skip_tests: false, **)
  return if skip_tests

  slice = inflector.underscore(Shellwords.shellescape(slice)) if slice
  key = inflector.underscore(Shellwords.shellescape(name))

  namespace = slice ? inflector.camelize(slice) : app.namespace
  base_path = slice ? "test/slices/#{slice}" : "test"

  generator = Generators::Action.new(fs:, inflector:)
  generator.call(key:, namespace:, base_path:)
end