Sha256: 5ea2a5cdec41e23323cb597b8d639bfa42d50a25df2c3bc08c43c078896e6578

Contents?: true

Size: 580 Bytes

Versions: 7

Compression:

Stored size: 580 Bytes

Contents

# frozen_string_literal: true

require "spec_helpers"

describe Wayfarer::Parsing::XML do
  subject(:parser) { Wayfarer::Parsing::XML }

  describe ".parse_html" do
    it "returns a Nokogiri::HTML::Document" do
      html_str = "<span>Foobar</span>"
      doc = parser.parse_html(html_str)

      expect(doc).to be_a Nokogiri::HTML::Document
    end
  end

  describe ".parse_xml" do
    it "returns a Nokogiri::XML::Document" do
      xml_str = "<barqux>Foobar</barqux>"
      doc = parser.parse_xml(xml_str)

      expect(doc).to be_a Nokogiri::XML::Document
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
wayfarer-0.4.6 spec/parsing/xml_spec.rb
wayfarer-0.4.5 spec/parsing/xml_spec.rb
wayfarer-0.4.4 spec/parsing/xml_spec.rb
wayfarer-0.4.3 spec/parsing/xml_spec.rb
wayfarer-0.4.2 spec/parsing/xml_spec.rb
wayfarer-0.4.1 spec/parsing/xml_spec.rb
wayfarer-0.4.0 spec/parsing/xml_spec.rb