Sha256: bdd599ad9b5bb63ba3e69036b468c089ec8f39b4e46ead380cd1807d912ac05a

Contents?: true

Size: 931 Bytes

Versions: 7

Compression:

Stored size: 931 Bytes

Contents

require 'mechanize/test_case'

class TestMechanizePluggableParser < Mechanize::TestCase

  def setup
    super

    @pp = @mech.pluggable_parser
  end

  def test_aref
    @pp['text/html'] = Mechanize::Download

    assert_equal Mechanize::Download, @pp['text/html']
  end

  def test_csv
    @pp.csv = Mechanize::Download

    assert_equal Mechanize::Download, @pp['text/csv']
  end

  def test_html
    assert_equal Mechanize::Page, @pp['text/html']

    @pp.html = Mechanize::Download

    assert_equal Mechanize::Download, @pp['text/html']
  end

  def test_parser
    assert_nil @pp['text/xml']

    assert_equal Mechanize::File, @pp.parser('text/xml')
  end

  def test_pdf
    @pp.pdf = Mechanize::Download

    assert_equal Mechanize::Download, @pp['application/pdf']
  end

  def test_xml
    assert_nil @pp['text/xml']

    @pp.xml = Mechanize::Download

    assert_equal Mechanize::Download, @pp['text/xml']
  end

end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
mechanize-2.1.1 test/test_mechanize_pluggable_parser.rb
domo-0.0.5 vendor/bundle/ruby/1.9.1/gems/mechanize-2.1/test/test_mechanize_pluggable_parser.rb
diamond-mechanize-2.4 test/test_mechanize_pluggable_parser.rb
diamond-mechanize-2.3 test/test_mechanize_pluggable_parser.rb
diamond-mechanize-2.1 test/test_mechanize_pluggable_parser.rb
mechanize-2.1 test/test_mechanize_pluggable_parser.rb
mechanize-2.1.pre.1 test/test_mechanize_pluggable_parser.rb