Module: HalSpec::Matchers::BeValidHal

Included in:
HalSpec::Matchers
Defined in:
lib/hal_spec/matchers/be_valid_hal.rb

Instance Method Summary collapse

Instance Method Details

#is_valid_hal?(str) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
7
# File 'lib/hal_spec/matchers/be_valid_hal.rb', line 4

def is_valid_hal?(str)
  JSON.parse(str) rescue return false
  return Halidator.new(str).valid?
end