Class | Mechanize::TestCase |
In: |
lib/mechanize/test_case.rb
|
Parent: | MiniTest::Unit::TestCase |
A generic test case for testing mechanize. Using a subclass of Mechanize::TestCase for your tests will create an isolated mechanize instance that won‘t pollute your filesystem or other tests.
Once Mechanize::TestCase is loaded no HTTP requests will be made outside mechanize itself. All requests are handled via WEBrick servlets.
Mechanize uses WEBrick servlets to test some functionality. You can run other HTTP clients against the servlets using:
ruby -rmechanize/test_case/server -e0
Which will launch a test server at localhost:8000
TEST_DIR | = | File.expand_path '../../../test', __FILE__ |
REQUESTS | = | [] |
Creates a Mechanize::Page for the given uri with the given content_type, response body and HTTP status code