class Confiner::Example

Representation of an example (test)

Attributes

classname[RW]
file[RW]
name[RW]
occurrence[RW]
status[RW]

Public Class Methods

new(**attributes) { |self| ... } click to toggle source
# File lib/confiner/example.rb, line 8
def initialize(**attributes)
  @status = attributes.fetch('status') { attributes.fetch(:status) }
  @name = attributes.fetch('name') { attributes.fetch(:name) }
  @classname = attributes.fetch('classname') { attributes.fetch(:classname) }
  @file = attributes.fetch('file') { attributes.fetch(:file) }
  @occurrence = attributes.fetch('occurrence') { attributes.fetch(:occurrence) }

  yield(self) if block_given?
end

Public Instance Methods

failed?() click to toggle source

Check if this example had failed @return [Boolean] true if the example had failed

# File lib/confiner/example.rb, line 26
def failed?
  status == 'failed'
end
passed?() click to toggle source

Check if this example had passed @return [Boolean] true if the example had passed

# File lib/confiner/example.rb, line 20
def passed?
  status == 'success'
end
skipped?() click to toggle source

Check if this example had been skipped @return [Boolean] true if the example had been skipped

# File lib/confiner/example.rb, line 32
def skipped?
  status == 'skipped'
end
to_s() click to toggle source
# File lib/confiner/example.rb, line 36
def to_s; name; end