Module: Awfy

Defined in:
lib/awfy.rb,
lib/awfy/cli.rb,
lib/awfy/version.rb

Defined Under Namespace

Classes: CLI

Constant Summary collapse

VERSION =
"0.4.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.groupsObject (readonly)

Returns the value of attribute groups.



15
16
17
# File 'lib/awfy.rb', line 15

def groups
  @groups
end

Class Method Details

.control(name, &block) ⇒ Object



22
23
24
# File 'lib/awfy.rb', line 22

def control(name, &block)
  @current_group[:reports].last[:tests] << {name:, block:, control: true}.freeze
end

.group(name) ⇒ Object



8
9
10
11
12
13
# File 'lib/awfy.rb', line 8

def group(name, &)
  @groups ||= {}
  @groups[name] ||= {name:, reports: []}.freeze
  @current_group = @groups[name]
  instance_eval(&)
end

.report(name) ⇒ Object



17
18
19
20
# File 'lib/awfy.rb', line 17

def report(name, &)
  @current_group[:reports] << {name:, tests: []}.freeze
  instance_eval(&)
end

.test(name, &block) ⇒ Object



26
27
28
# File 'lib/awfy.rb', line 26

def test(name, &block)
  @current_group[:reports].last[:tests] << {name:, block:}.freeze
end