Class: Hanami::CLI::Commands::New::TestFramework Private

Inherits:
Object
  • Object
show all
Defined in:
lib/hanami/cli/commands/new.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:

  • 1.1.0

Constant Summary collapse

RSPEC =

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

Since:

  • 1.1.0

'rspec'.freeze
MINITEST =

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

Since:

  • 1.1.0

'minitest'.freeze
VALID_FRAMEWORKS =

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

Since:

  • 1.1.0

[RSPEC, MINITEST].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hanamirc, framework) ⇒ TestFramework

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.

Returns a new instance of TestFramework

Since:

  • 1.1.0



157
158
159
160
# File 'lib/hanami/cli/commands/new.rb', line 157

def initialize(hanamirc, framework)
  @framework = (framework || hanamirc.options.fetch(:test))
  assert_framework!
end

Instance Attribute Details

#frameworkObject (readonly)

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:

  • 1.1.0



153
154
155
# File 'lib/hanami/cli/commands/new.rb', line 153

def framework
  @framework
end

Instance Method Details

#minitest?Boolean

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.

Returns:

  • (Boolean)

Since:

  • 1.1.0



170
171
172
# File 'lib/hanami/cli/commands/new.rb', line 170

def minitest?
  framework == MINITEST
end

#rspec?Boolean

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.

Returns:

  • (Boolean)

Since:

  • 1.1.0



164
165
166
# File 'lib/hanami/cli/commands/new.rb', line 164

def rspec?
  framework == RSPEC
end