Class: Konacha::Reporter::Example

Inherits:
Object
  • Object
show all
Defined in:
lib/konacha/reporter/example.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, parent) ⇒ Example

Returns a new instance of Example.



10
11
12
13
14
15
16
# File 'lib/konacha/reporter/example.rb', line 10

def initialize(data, parent)
  @metadata = Metadata.new(data)
  @parent = parent
  if parent
    (example_group: parent.)
  end
end

Instance Attribute Details

#metadataObject (readonly) Also known as: options

Returns the value of attribute metadata.



8
9
10
# File 'lib/konacha/reporter/example.rb', line 8

def 
  @metadata
end

#parentObject (readonly) Also known as: example_group

Returns the value of attribute parent.



8
9
10
# File 'lib/konacha/reporter/example.rb', line 8

def parent
  @parent
end

Instance Method Details

#[](key) ⇒ Object



36
37
38
# File 'lib/konacha/reporter/example.rb', line 36

def [](key)
  respond_to?(key) ? send(key) : [key]
end

#failed?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/konacha/reporter/example.rb', line 28

def failed?
  execution_result[:status] == "failed"
end

#passed?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/konacha/reporter/example.rb', line 24

def passed?
  execution_result[:status] == "passed"
end

#update_metadata(data) ⇒ Object



32
33
34
# File 'lib/konacha/reporter/example.rb', line 32

def (data)
  .update(data)
end