Module: Trailblazer::Test::Assertions
- Defined in:
- lib/trailblazer/test/assertions.rb
Class Method Summary collapse
-
.assert_exposes(asserted, tuples, reader: nil) ⇒ Object
Test if all ‘tuples` values on `asserted` match the expected values.
Class Method Details
.assert_exposes(asserted, tuples, reader: nil) ⇒ Object
Test if all ‘tuples` values on `asserted` match the expected values. TODO: test err msgs!
25 26 27 28 29 30 31 32 |
# File 'lib/trailblazer/test/assertions.rb', line 25 def assert_exposes(asserted, tuples, reader: nil) tuples.each do |k, v| actual = Test.actual(asserted, reader, k) expected, is_eq = Test.expected(asserted, v, actual) is_eq ? assert_equal(expected, actual, "Property [#{k}] mismatch") : assert(expected, "Actual: #{actual.inspect}.") end end |