Sha256: 52ee4b0724d17573d0ff95c5daa4e88b99d4117cf811fa1f56981fb8ed0e733b

Contents?: true

Size: 595 Bytes

Versions: 4

Compression:

Stored size: 595 Bytes

Contents

require File.dirname(__FILE__) + "/helper"

class TestPage < Test::Unit::TestCase
  def setup
    @agent = WWW::Mechanize.new
  end

  def test_page_gets_yielded
    pages = nil
    @agent.get("http://localhost/file_upload.html") { |page|
      pages = page
    }
    assert pages
    assert_equal('File Upload Form', pages.title)
  end

  def test_title
    page = @agent.get("http://localhost/file_upload.html")
    assert_equal('File Upload Form', page.title)
  end

  def test_no_title
    page = @agent.get("http://localhost/no_title_test.html")
    assert_equal(nil, page.title)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mechanize-0.7.4 test/tc_page.rb
mechanize-0.7.3 test/tc_page.rb
mechanize-0.7.5 test/tc_page.rb
mechanize-0.7.6 test/tc_page.rb