Sha256: 0320e4fd4fcb912f1a3e352ebd683da94e71395da7f5f9c5853980b005de6a2c
Contents?: true
Size: 937 Bytes
Versions: 2
Compression:
Stored size: 937 Bytes
Contents
# frozen_string_literal: true require 'helper' require 'peddler/parser' class TestPeddlerParser < MiniTest::Test def assert_parser(klass, *content_types, body: '') content_types.each do |content_type| res = OpenStruct.new( headers: { 'Content-Type' => content_type }, body: body ) parser = Peddler::Parser.new(res, 'Cp1252') assert_kind_of klass, parser end end def test_parsing_xml assert_parser Peddler::XMLParser, 'text/xml', 'text/xml; charset=UTF-8' end def test_parsing_incorrect_content_type assert_parser Peddler::XMLParser, 'xml; charset=UTF-8', body: '<?xml version="1.0"?><GetLowestOfferListingsForASINResponse>...' end def test_parsing_flat_files assert_parser Peddler::FlatFileParser, 'text/plain', 'application/octet-stream' end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
peddler-2.1.1 | test/unit/peddler/test_parser.rb |
peddler-2.1.0 | test/unit/peddler/test_parser.rb |