Module: MediaTypes::Testing::Assertions

Defined in:
lib/media_types/testing/assertions.rb

Instance Method Summary collapse

Instance Method Details

#assert_media_type_format(media_type, output, **opts) ⇒ Object



6
7
8
9
10
# File 'lib/media_types/testing/assertions.rb', line 6

def assert_media_type_format(media_type, output, **opts)
  return pass unless media_type.validatable?

  assert media_type.validate!(output, **opts)
end

#assert_mediatype(mediatype) ⇒ Object



12
13
14
15
16
17
# File 'lib/media_types/testing/assertions.rb', line 12

def assert_mediatype(mediatype)
  mediatype.assert_sane!
  assert mediatype.media_type_validations.scheme.asserted_sane?
rescue MediaTypes::AssertionError => e
  flunk e.message
end