Sha256: f1a333150f50bec755c7c663b7f171a67b1b22811f0e7c72e98613a85dc6bca9

Contents?: true

Size: 431 Bytes

Versions: 5

Compression:

Stored size: 431 Bytes

Contents

require 'test_helper'
require 'vedeu/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

5 entries across 5 versions & 1 rubygems

Version Path
vedeu-0.1.1 test/lib/vedeu/parsing/json_parser_test.rb
vedeu-0.1.0 test/lib/vedeu/parsing/json_parser_test.rb
vedeu-0.0.42 test/lib/vedeu/parsing/json_parser_test.rb
vedeu-0.0.41 test/lib/vedeu/parsing/json_parser_test.rb
vedeu-0.0.40 test/lib/vedeu/parsing/json_parser_test.rb