Module: Minitest::Assertions

Defined in:
lib/katachi/minitest.rb

Overview

Minitest assertions for shape matching

Instance Method Summary collapse

Instance Method Details

#assert_shape(expected, actual) ⇒ Object



8
9
10
# File 'lib/katachi/minitest.rb', line 8

def assert_shape(expected, actual)
  assert Katachi.compare(shape: expected, value: actual).match?, "Expected #{actual} to match #{expected}"
end

#refute_shape(expected, actual) ⇒ Object



12
13
14
# File 'lib/katachi/minitest.rb', line 12

def refute_shape(expected, actual)
  refute Katachi.compare(shape: expected, value: actual).match?, "Expected #{actual} not to match #{expected}"
end