Class: CapturefulFormatter::Structures::Feature

Inherits:
Object
  • Object
show all
Defined in:
lib/captureful_formatter/structures.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(notification) ⇒ Feature

notification

GroupNotification



13
14
15
16
# File 'lib/captureful_formatter/structures.rb', line 13

def initialize(notification)
  @description = notification.group.description
  @scenarios = []
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



9
10
11
# File 'lib/captureful_formatter/structures.rb', line 9

def description
  @description
end

#scenariosObject

Returns the value of attribute scenarios.



8
9
10
# File 'lib/captureful_formatter/structures.rb', line 8

def scenarios
  @scenarios
end

Instance Method Details

#all_passedObject



18
19
20
# File 'lib/captureful_formatter/structures.rb', line 18

def all_passed
  @scenarios.count == num_passed
end

#num_failedObject



30
31
32
# File 'lib/captureful_formatter/structures.rb', line 30

def num_failed
  @scenarios.count {|scenario| scenario.status == :failed }
end

#num_passedObject



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

def num_passed
  @scenarios.count {|scenario| scenario.status == :passed }
end

#num_pendingObject



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

def num_pending
  @scenarios.count {|scenario| scenario.status == :pending }
end