Class: TestTube::Passer Private

Inherits:
Base
  • Object
show all
Defined in:
lib/test_tube/passer.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Evaluate an actual value passed in parameter.

Instance Attribute Summary

Attributes inherited from Base

#actual, #error, #got

Instance Method Summary collapse

Methods inherited from Base

#inspect

Constructor Details

#initialize(input, matcher:, negate:) ⇒ Passer

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Class initializer.

Parameters:

  • input (#object_id)

    The actual value to test.

  • matcher (#matches?)

    A matcher.

  • negate (Boolean)

    Invert the matcher or not.



15
16
17
18
19
20
# File 'lib/test_tube/passer.rb', line 15

def initialize(input, matcher:, negate:)
  super()

  @actual = input
  @got = negate ^ matcher.matches? { input }
end