Sha256: 8f9d79fa2274453c94dd906daacd766e45026bf8b30f91498af8c6893a55aa27

Contents?: true

Size: 430 Bytes

Versions: 5

Compression:

Stored size: 430 Bytes

Contents

require 'test_helper'
require 'vedeu/output/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.6 test/lib/vedeu/output/json_parser_test.rb
vedeu-0.1.5 test/lib/vedeu/output/json_parser_test.rb
vedeu-0.1.4 test/lib/vedeu/output/json_parser_test.rb
vedeu-0.1.3 test/lib/vedeu/output/json_parser_test.rb
vedeu-0.1.2 test/lib/vedeu/output/json_parser_test.rb