Class: Hanami::Generators::TestFramework

Inherits:
Object
  • Object
show all
Defined in:
lib/hanami/generators/test_framework.rb

Constant Summary collapse

RSPEC =
'rspec'.freeze
MINITEST =
'minitest'.freeze
VALID_FRAMEWORKS =
[MINITEST, RSPEC].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hanamirc, framework) ⇒ TestFramework


11
12
13
14
# File 'lib/hanami/generators/test_framework.rb', line 11

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

Instance Attribute Details

#frameworkObject (readonly)

Returns the value of attribute framework


9
10
11
# File 'lib/hanami/generators/test_framework.rb', line 9

def framework
  @framework
end

Instance Method Details

#minitest?Boolean


20
21
22
# File 'lib/hanami/generators/test_framework.rb', line 20

def minitest?
  framework == MINITEST
end

#rspec?Boolean


16
17
18
# File 'lib/hanami/generators/test_framework.rb', line 16

def rspec?
  framework == RSPEC
end