Class: Omnitest::Skeptic::Validation

Inherits:
Core::Dash
  • Object
show all
Defined in:
lib/omnitest/skeptic/validation.rb

Constant Summary collapse

ALLOWABLE_STATES =

TODO: Should we have (expectation) ‘failed’ vs (unexpected) ‘error’?

%w(passed pending failed skipped)

Instance Method Summary collapse

Instance Method Details

#error_source?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/omnitest/skeptic/validation.rb', line 23

def error_source?
  !error_source.nil?
end

#status=(state) ⇒ Object



11
12
13
14
15
# File 'lib/omnitest/skeptic/validation.rb', line 11

def status=(state)
  state = state.to_s
  fail invalidate_state_error unless ALLOWABLE_STATES.include? state
  super
end

#to_hash(*args) ⇒ Object



27
28
29
30
# File 'lib/omnitest/skeptic/validation.rb', line 27

def to_hash(*args)
  self.error_source = error.error_source if error.respond_to? :error_source
  super
end