Sha256: 86572628cb3076f2c6d1a3365bd4d5089e953d757451ccbb8cef0f35356581fe

Contents?: true

Size: 488 Bytes

Versions: 4

Compression:

Stored size: 488 Bytes

Contents

require_relative '../../../../test_helper'
require_relative '../../../../../lib/vedeu/support/parsing/json_parser'

module Vedeu
  describe JSONParser do
    describe '.parse' do
      it 'returns a hash when the JSON is valid' do
        JSONParser.parse("{\"some\": \"JSON\"}")
          .must_be_instance_of(Hash)
      end

      it 'returns an empty hash when the JSON is invalid' do
        JSONParser.parse('{ invalid JSON }').must_be_instance_of(Hash)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vedeu-0.0.36 test/lib/vedeu/support/parsing/json_parser_test.rb
vedeu-0.0.35 test/lib/vedeu/support/parsing/json_parser_test.rb
vedeu-0.0.34 test/lib/vedeu/support/parsing/json_parser_test.rb
vedeu-0.0.33 test/lib/vedeu/support/parsing/json_parser_test.rb