class Riot::RR::Assertion

Binds the {Riot::Assertion} to RR so that successes and failures found by RR are inherently handled during an assertion evaluation. In effect, if RR suggests failure during validation, the assertion will fail and report these failures.

Public Instance Methods

run(situation) click to toggle source

Adds RR support to {Riot::Assertion#run}. The basic flow is to:

  • run the test as normal

  • ask RR to verify mock results

  • report any errors or return the result of the assertion as normal

  • reset RR so that the next assertion in the context can be verified cleanly.

@param (see Riot::Assertion#run) @return (see Riot::Assertion#run)

Calls superclass method Riot::Assertion#run
# File lib/riot/rr.rb, line 27
def run(situation)
  result = super
  situation.verify
  result
rescue ::RR::Errors::RRError => e
  result.first == :pass ? [:fail, e.message.gsub(/\n/, " ")] : result
ensure
  situation.reset
end