Class: Lotus::Generators::TestFramework

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

Overview

Since:

  • 0.1.0

Constant Summary collapse

RSPEC =

Since:

  • 0.1.0

'rspec'.freeze
MINITEST =

Since:

  • 0.1.0

'minitest'.freeze
VALID_FRAMEWORKS =

Since:

  • 0.1.0

[RSPEC, MINITEST].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lotusrc, framework) ⇒ TestFramework

Returns a new instance of TestFramework.

Since:

  • 0.1.0



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

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

Instance Attribute Details

#frameworkObject (readonly)

Since:

  • 0.1.0



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

def framework
  @framework
end

Instance Method Details

#minitest?Boolean

Returns:

  • (Boolean)

Since:

  • 0.1.0



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

def minitest?
  framework == MINITEST
end

#rspec?Boolean

Returns:

  • (Boolean)

Since:

  • 0.1.0



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

def rspec?
  framework == RSPEC
end