mechanize 0.6.11 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of mechanize might be problematic. Click here for more details.
- data/CHANGELOG.txt +8 -0
- data/Manifest.txt +31 -22
- data/lib/mechanize.rb +2 -652
- data/lib/www/mechanize.rb +635 -0
- data/lib/www/mechanize/content_type_error.rb +16 -0
- data/lib/www/mechanize/cookie.rb +64 -0
- data/lib/{mechanize/cookie.rb → www/mechanize/cookie_jar.rb} +0 -60
- data/lib/www/mechanize/file.rb +73 -0
- data/lib/www/mechanize/file_saver.rb +39 -0
- data/lib/{mechanize → www/mechanize}/form.rb +119 -137
- data/lib/www/mechanize/form/button.rb +8 -0
- data/lib/www/mechanize/form/check_box.rb +13 -0
- data/lib/www/mechanize/form/field.rb +28 -0
- data/lib/www/mechanize/form/file_upload.rb +24 -0
- data/lib/www/mechanize/form/image_button.rb +23 -0
- data/lib/www/mechanize/form/multi_select_list.rb +69 -0
- data/lib/www/mechanize/form/option.rb +51 -0
- data/lib/www/mechanize/form/radio_button.rb +38 -0
- data/lib/www/mechanize/form/select_list.rb +41 -0
- data/lib/www/mechanize/headers.rb +12 -0
- data/lib/{mechanize → www/mechanize}/history.rb +0 -0
- data/lib/{mechanize → www/mechanize}/inspect.rb +21 -28
- data/lib/{mechanize → www/mechanize}/list.rb +0 -0
- data/lib/{mechanize → www/mechanize}/monkey_patch.rb +19 -0
- data/lib/www/mechanize/page.rb +121 -0
- data/lib/www/mechanize/page/base.rb +10 -0
- data/lib/www/mechanize/page/frame.rb +22 -0
- data/lib/www/mechanize/page/link.rb +50 -0
- data/lib/www/mechanize/page/meta.rb +10 -0
- data/lib/www/mechanize/pluggable_parsers.rb +93 -0
- data/lib/{mechanize/errors.rb → www/mechanize/response_code_error.rb} +1 -13
- data/test/{test_includes.rb → helper.rb} +4 -18
- data/test/{test_servlets.rb → servlets.rb} +0 -0
- data/test/tc_authenticate.rb +1 -8
- data/test/tc_bad_links.rb +3 -10
- data/test/tc_blank_form.rb +1 -8
- data/test/tc_checkboxes.rb +1 -8
- data/test/tc_cookie_class.rb +1 -6
- data/test/tc_cookie_jar.rb +1 -7
- data/test/tc_cookies.rb +10 -17
- data/test/tc_encoded_links.rb +5 -12
- data/test/tc_errors.rb +4 -11
- data/test/tc_follow_meta.rb +1 -8
- data/test/tc_form_action.rb +6 -14
- data/test/tc_form_as_hash.rb +1 -9
- data/test/tc_form_button.rb +5 -8
- data/test/tc_form_no_inputname.rb +1 -8
- data/test/tc_forms.rb +16 -24
- data/test/tc_frames.rb +3 -10
- data/test/tc_gzipping.rb +2 -9
- data/test/tc_history.rb +5 -12
- data/test/tc_html_unscape_forms.rb +8 -15
- data/test/tc_if_modified_since.rb +1 -6
- data/test/tc_keep_alive.rb +1 -8
- data/test/tc_links.rb +12 -19
- data/test/tc_mech.rb +26 -34
- data/test/{test_mechanize_file.rb → tc_mechanize_file.rb} +1 -6
- data/test/tc_multi_select.rb +10 -17
- data/test/tc_no_attributes.rb +1 -8
- data/test/tc_page.rb +3 -10
- data/test/tc_pluggable_parser.rb +8 -15
- data/test/tc_post_form.rb +3 -10
- data/test/tc_pretty_print.rb +3 -10
- data/test/tc_radiobutton.rb +2 -9
- data/test/tc_referer.rb +13 -20
- data/test/tc_relative_links.rb +1 -8
- data/test/tc_response_code.rb +14 -21
- data/test/tc_save_file.rb +1 -9
- data/test/tc_select.rb +3 -10
- data/test/tc_select_all.rb +2 -10
- data/test/tc_select_none.rb +2 -10
- data/test/tc_select_noopts.rb +2 -9
- data/test/tc_set_fields.rb +2 -9
- data/test/tc_ssl_server.rb +5 -12
- data/test/tc_subclass.rb +2 -9
- data/test/tc_textarea.rb +2 -9
- data/test/tc_upload.rb +2 -9
- data/test/test_all.rb +4 -43
- metadata +96 -80
- data/lib/mechanize/form_elements.rb +0 -254
- data/lib/mechanize/net-overrides/net/http.rb +0 -2107
- data/lib/mechanize/net-overrides/net/https.rb +0 -172
- data/lib/mechanize/net-overrides/net/protocol.rb +0 -380
- data/lib/mechanize/page.rb +0 -138
- data/lib/mechanize/page_elements.rb +0 -77
- data/lib/mechanize/parsers/rexml_page.rb +0 -35
- data/lib/mechanize/pluggable_parsers.rb +0 -204
- data/lib/mechanize/rexml.rb +0 -236
- data/setup.rb +0 -1585
- data/test/tc_proxy.rb +0 -25
- data/test/tc_watches.rb +0 -32
data/test/tc_no_attributes.rb
CHANGED
@@ -1,13 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'test/unit'
|
4
|
-
require 'rubygems'
|
5
|
-
require 'mechanize'
|
6
|
-
require 'test_includes'
|
1
|
+
require File.dirname(__FILE__) + "/helper"
|
7
2
|
|
8
3
|
class TestNoAttributes < Test::Unit::TestCase
|
9
|
-
include TestMethods
|
10
|
-
|
11
4
|
def setup
|
12
5
|
@agent = WWW::Mechanize.new
|
13
6
|
end
|
data/test/tc_page.rb
CHANGED
@@ -1,24 +1,17 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'test/unit'
|
4
|
-
require 'rubygems'
|
5
|
-
require 'mechanize'
|
6
|
-
require 'test_includes'
|
1
|
+
require File.dirname(__FILE__) + "/helper"
|
7
2
|
|
8
3
|
class TestPage < Test::Unit::TestCase
|
9
|
-
include TestMethods
|
10
|
-
|
11
4
|
def setup
|
12
5
|
@agent = WWW::Mechanize.new
|
13
6
|
end
|
14
7
|
|
15
8
|
def test_title
|
16
|
-
page = @agent.get("http://localhost
|
9
|
+
page = @agent.get("http://localhost/file_upload.html")
|
17
10
|
assert_equal('File Upload Form', page.title)
|
18
11
|
end
|
19
12
|
|
20
13
|
def test_no_title
|
21
|
-
page = @agent.get("http://localhost
|
14
|
+
page = @agent.get("http://localhost/no_title_test.html")
|
22
15
|
assert_equal(nil, page.title)
|
23
16
|
end
|
24
17
|
end
|
data/test/tc_pluggable_parser.rb
CHANGED
@@ -1,19 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'test/unit'
|
4
|
-
require 'rubygems'
|
5
|
-
require 'mechanize'
|
6
|
-
require 'test_includes'
|
1
|
+
require File.dirname(__FILE__) + "/helper"
|
7
2
|
|
8
3
|
class PluggableParserTest < Test::Unit::TestCase
|
9
|
-
include TestMethods
|
10
|
-
|
11
4
|
def setup
|
12
5
|
@agent = WWW::Mechanize.new
|
13
6
|
end
|
14
7
|
|
15
8
|
def test_content_type_error
|
16
|
-
page = @agent.get("http://localhost
|
9
|
+
page = @agent.get("http://localhost/bad_content_type")
|
17
10
|
assert_raise(WWW::Mechanize::ContentTypeError) {
|
18
11
|
page = WWW::Mechanize::Page.new(
|
19
12
|
page.uri,
|
@@ -35,7 +28,7 @@ class PluggableParserTest < Test::Unit::TestCase
|
|
35
28
|
end
|
36
29
|
|
37
30
|
def test_content_type
|
38
|
-
page = @agent.get("http://localhost
|
31
|
+
page = @agent.get("http://localhost/content_type_test")
|
39
32
|
assert_kind_of(WWW::Mechanize::Page, page)
|
40
33
|
end
|
41
34
|
|
@@ -61,7 +54,7 @@ class PluggableParserTest < Test::Unit::TestCase
|
|
61
54
|
|
62
55
|
def test_filter
|
63
56
|
@agent.pluggable_parser.html = Filter
|
64
|
-
page = @agent.get("http://localhost
|
57
|
+
page = @agent.get("http://localhost/find_link.html")
|
65
58
|
assert_kind_of(Filter, page)
|
66
59
|
assert_equal(19, page.links.length)
|
67
60
|
assert_not_nil(page.links.text('Net::DAAP::Client').first)
|
@@ -70,7 +63,7 @@ class PluggableParserTest < Test::Unit::TestCase
|
|
70
63
|
|
71
64
|
def test_filter_hash
|
72
65
|
@agent.pluggable_parser['text/html'] = Filter
|
73
|
-
page = @agent.get("http://localhost
|
66
|
+
page = @agent.get("http://localhost/find_link.html")
|
74
67
|
assert_kind_of(Class, @agent.pluggable_parser['text/html'])
|
75
68
|
assert_equal(Filter, @agent.pluggable_parser['text/html'])
|
76
69
|
assert_kind_of(Filter, page)
|
@@ -93,7 +86,7 @@ class PluggableParserTest < Test::Unit::TestCase
|
|
93
86
|
|
94
87
|
def test_content_type_pdf
|
95
88
|
@agent.pluggable_parser.pdf = FileFilter
|
96
|
-
page = @agent.get("http://localhost
|
89
|
+
page = @agent.get("http://localhost/content_type_test?ct=application/pdf")
|
97
90
|
assert_kind_of(Class, @agent.pluggable_parser['application/pdf'])
|
98
91
|
assert_equal(FileFilter, @agent.pluggable_parser['application/pdf'])
|
99
92
|
assert_kind_of(FileFilter, page)
|
@@ -101,7 +94,7 @@ class PluggableParserTest < Test::Unit::TestCase
|
|
101
94
|
|
102
95
|
def test_content_type_csv
|
103
96
|
@agent.pluggable_parser.csv = FileFilter
|
104
|
-
page = @agent.get("http://localhost
|
97
|
+
page = @agent.get("http://localhost/content_type_test?ct=text/csv")
|
105
98
|
assert_kind_of(Class, @agent.pluggable_parser['text/csv'])
|
106
99
|
assert_equal(FileFilter, @agent.pluggable_parser['text/csv'])
|
107
100
|
assert_kind_of(FileFilter, page)
|
@@ -109,7 +102,7 @@ class PluggableParserTest < Test::Unit::TestCase
|
|
109
102
|
|
110
103
|
def test_content_type_xml
|
111
104
|
@agent.pluggable_parser.xml = FileFilter
|
112
|
-
page = @agent.get("http://localhost
|
105
|
+
page = @agent.get("http://localhost/content_type_test?ct=text/xml")
|
113
106
|
assert_kind_of(Class, @agent.pluggable_parser['text/xml'])
|
114
107
|
assert_equal(FileFilter, @agent.pluggable_parser['text/xml'])
|
115
108
|
assert_kind_of(FileFilter, page)
|
data/test/tc_post_form.rb
CHANGED
@@ -1,19 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'test/unit'
|
4
|
-
require 'rubygems'
|
5
|
-
require 'mechanize'
|
6
|
-
require 'test_includes'
|
1
|
+
require File.dirname(__FILE__) + "/helper"
|
7
2
|
|
8
3
|
class PostForm < Test::Unit::TestCase
|
9
|
-
include TestMethods
|
10
|
-
|
11
4
|
def setup
|
12
5
|
@agent = WWW::Mechanize.new
|
13
6
|
end
|
14
7
|
|
15
8
|
def test_post_form
|
16
|
-
page = @agent.post("http://localhost
|
9
|
+
page = @agent.post("http://localhost/form_post",
|
17
10
|
'gender' => 'female'
|
18
11
|
)
|
19
12
|
assert_not_nil(
|
@@ -23,7 +16,7 @@ class PostForm < Test::Unit::TestCase
|
|
23
16
|
end
|
24
17
|
|
25
18
|
def test_post_form_multival
|
26
|
-
page = @agent.post("http://localhost
|
19
|
+
page = @agent.post("http://localhost/form_post",
|
27
20
|
[ ['gender', 'female'],
|
28
21
|
['gender', 'male']
|
29
22
|
]
|
data/test/tc_pretty_print.rb
CHANGED
@@ -1,25 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'test/unit'
|
4
|
-
require 'rubygems'
|
5
|
-
require 'mechanize'
|
6
|
-
require 'test_includes'
|
1
|
+
require File.dirname(__FILE__) + "/helper"
|
7
2
|
|
8
3
|
class TestPrettyPrint < Test::Unit::TestCase
|
9
|
-
include TestMethods
|
10
|
-
|
11
4
|
def setup
|
12
5
|
@agent = WWW::Mechanize.new
|
13
6
|
end
|
14
7
|
|
15
8
|
def test_pretty_print
|
16
|
-
@agent.get("http://localhost
|
9
|
+
@agent.get("http://localhost/tc_pretty_print.html")
|
17
10
|
pretty_string = @agent.pretty_print_inspect
|
18
11
|
assert_match("{title \"tc_pretty_print.html\"}", pretty_string)
|
19
12
|
assert_match(/\{frames[^"]*"http:\/\/meme/, pretty_string)
|
20
13
|
assert_match(/\{iframes[^"]*"http:\/\/meme/, pretty_string)
|
21
14
|
assert_match(
|
22
|
-
"{links #<WWW::Mechanize::Link \"Google\" \"http://google.com/\">}",
|
15
|
+
"{links #<WWW::Mechanize::Page::Link \"Google\" \"http://google.com/\">}",
|
23
16
|
pretty_string
|
24
17
|
)
|
25
18
|
assert_match("form1", pretty_string)
|
data/test/tc_radiobutton.rb
CHANGED
@@ -1,16 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'test/unit'
|
4
|
-
require 'rubygems'
|
5
|
-
require 'mechanize'
|
6
|
-
require 'test_includes'
|
1
|
+
require File.dirname(__FILE__) + "/helper"
|
7
2
|
|
8
3
|
class TestRadioButtons < Test::Unit::TestCase
|
9
|
-
include TestMethods
|
10
|
-
|
11
4
|
def setup
|
12
5
|
@agent = WWW::Mechanize.new
|
13
|
-
@page = @agent.get("http://localhost
|
6
|
+
@page = @agent.get("http://localhost/tc_radiobuttons.html")
|
14
7
|
end
|
15
8
|
|
16
9
|
def test_select_one
|
data/test/tc_referer.rb
CHANGED
@@ -1,46 +1,39 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'test/unit'
|
4
|
-
require 'rubygems'
|
5
|
-
require 'mechanize'
|
6
|
-
require 'test_includes'
|
1
|
+
require File.dirname(__FILE__) + "/helper"
|
7
2
|
|
8
3
|
class RefererTest < Test::Unit::TestCase
|
9
|
-
include TestMethods
|
10
|
-
|
11
4
|
def setup
|
12
5
|
@agent = WWW::Mechanize.new
|
13
6
|
end
|
14
7
|
|
15
8
|
def test_no_referer
|
16
|
-
page = @agent.get("http://localhost
|
9
|
+
page = @agent.get("http://localhost/referer")
|
17
10
|
assert_equal('', page.body)
|
18
11
|
end
|
19
12
|
|
20
13
|
def test_send_referer
|
21
|
-
page = @agent.get("http://localhost
|
14
|
+
page = @agent.get("http://localhost/tc_referer.html")
|
22
15
|
page = @agent.click page.links.first
|
23
|
-
assert_equal("http://localhost
|
16
|
+
assert_equal("http://localhost/tc_referer.html", page.body)
|
24
17
|
end
|
25
18
|
|
26
19
|
def test_fetch_two
|
27
|
-
page1 = @agent.get("http://localhost
|
28
|
-
page2 = @agent.get("http://localhost
|
20
|
+
page1 = @agent.get("http://localhost/tc_referer.html")
|
21
|
+
page2 = @agent.get("http://localhost/tc_pretty_print.html")
|
29
22
|
page = @agent.click page1.links.first
|
30
|
-
assert_equal("http://localhost
|
23
|
+
assert_equal("http://localhost/tc_referer.html", page.body)
|
31
24
|
end
|
32
25
|
|
33
26
|
def test_fetch_two_first
|
34
|
-
page1 = @agent.get("http://localhost
|
35
|
-
page2 = @agent.get("http://localhost
|
27
|
+
page1 = @agent.get("http://localhost/tc_referer.html")
|
28
|
+
page2 = @agent.get("http://localhost/tc_pretty_print.html")
|
36
29
|
page = @agent.click page1.links
|
37
|
-
assert_equal("http://localhost
|
30
|
+
assert_equal("http://localhost/tc_referer.html", page.body)
|
38
31
|
end
|
39
32
|
|
40
33
|
def test_post_form
|
41
|
-
page1 = @agent.get("http://localhost
|
42
|
-
page2 = @agent.get("http://localhost
|
34
|
+
page1 = @agent.get("http://localhost/tc_referer.html")
|
35
|
+
page2 = @agent.get("http://localhost/tc_pretty_print.html")
|
43
36
|
page = @agent.submit page1.forms.first
|
44
|
-
assert_equal("http://localhost
|
37
|
+
assert_equal("http://localhost/tc_referer.html", page.body)
|
45
38
|
end
|
46
39
|
end
|
data/test/tc_relative_links.rb
CHANGED
@@ -1,13 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'test/unit'
|
4
|
-
require 'rubygems'
|
5
|
-
require 'mechanize'
|
6
|
-
require 'test_includes'
|
1
|
+
require File.dirname(__FILE__) + "/helper"
|
7
2
|
|
8
3
|
class TestRelativeLinks < Test::Unit::TestCase
|
9
|
-
include TestMethods
|
10
|
-
|
11
4
|
def setup
|
12
5
|
@agent = WWW::Mechanize.new
|
13
6
|
end
|
data/test/tc_response_code.rb
CHANGED
@@ -1,51 +1,44 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'test/unit'
|
4
|
-
require 'rubygems'
|
5
|
-
require 'mechanize'
|
6
|
-
require 'test_includes'
|
1
|
+
require File.dirname(__FILE__) + "/helper"
|
7
2
|
|
8
3
|
class ResponseCodeMechTest < Test::Unit::TestCase
|
9
|
-
include TestMethods
|
10
|
-
|
11
4
|
def setup
|
12
5
|
@agent = WWW::Mechanize.new
|
13
6
|
end
|
14
7
|
|
15
8
|
def test_redirect
|
16
|
-
@agent.get("http://localhost
|
17
|
-
assert_equal("http://localhost
|
9
|
+
@agent.get("http://localhost/response_code?code=300")
|
10
|
+
assert_equal("http://localhost/index.html",
|
18
11
|
@agent.current_page.uri.to_s)
|
19
12
|
|
20
|
-
@agent.get("http://localhost
|
21
|
-
assert_equal("http://localhost
|
13
|
+
@agent.get("http://localhost/response_code?code=301")
|
14
|
+
assert_equal("http://localhost/index.html",
|
22
15
|
@agent.current_page.uri.to_s)
|
23
16
|
|
24
|
-
@agent.get("http://localhost
|
25
|
-
assert_equal("http://localhost
|
17
|
+
@agent.get("http://localhost/response_code?code=302")
|
18
|
+
assert_equal("http://localhost/index.html",
|
26
19
|
@agent.current_page.uri.to_s)
|
27
20
|
|
28
|
-
@agent.get("http://localhost
|
29
|
-
assert_equal("http://localhost
|
21
|
+
@agent.get("http://localhost/response_code?code=303")
|
22
|
+
assert_equal("http://localhost/index.html",
|
30
23
|
@agent.current_page.uri.to_s)
|
31
24
|
|
32
|
-
@agent.get("http://localhost
|
33
|
-
assert_equal("http://localhost
|
25
|
+
@agent.get("http://localhost/response_code?code=307")
|
26
|
+
assert_equal("http://localhost/index.html",
|
34
27
|
@agent.current_page.uri.to_s)
|
35
28
|
end
|
36
29
|
|
37
30
|
def test_do_not_follow_redirect
|
38
31
|
@agent.redirect_ok = false
|
39
32
|
|
40
|
-
@agent.get("http://localhost
|
41
|
-
assert_equal("http://localhost
|
33
|
+
@agent.get("http://localhost/response_code?code=302")
|
34
|
+
assert_equal("http://localhost/response_code?code=302",
|
42
35
|
@agent.current_page.uri.to_s)
|
43
36
|
end
|
44
37
|
|
45
38
|
def test_error
|
46
39
|
@agent = WWW::Mechanize.new
|
47
40
|
begin
|
48
|
-
@agent.get("http://localhost
|
41
|
+
@agent.get("http://localhost/response_code?code=500")
|
49
42
|
rescue WWW::Mechanize::ResponseCodeError => err
|
50
43
|
assert_equal("500", err.response_code)
|
51
44
|
end
|
data/test/tc_save_file.rb
CHANGED
@@ -1,14 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'test/unit'
|
4
|
-
require 'rubygems'
|
5
|
-
require 'mechanize'
|
6
|
-
require 'test_includes'
|
7
|
-
require 'fileutils'
|
1
|
+
require File.dirname(__FILE__) + "/helper"
|
8
2
|
|
9
3
|
class TestSaveFile < Test::Unit::TestCase
|
10
|
-
include TestMethods
|
11
|
-
|
12
4
|
def setup
|
13
5
|
@agent = WWW::Mechanize.new
|
14
6
|
end
|
data/test/tc_select.rb
CHANGED
@@ -1,16 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'test/unit'
|
4
|
-
require 'rubygems'
|
5
|
-
require 'mechanize'
|
6
|
-
require 'test_includes'
|
1
|
+
require File.dirname(__FILE__) + "/helper"
|
7
2
|
|
8
3
|
class SelectTest < Test::Unit::TestCase
|
9
|
-
include TestMethods
|
10
|
-
|
11
4
|
def setup
|
12
5
|
@agent = WWW::Mechanize.new
|
13
|
-
@page = @agent.get("http://localhost
|
6
|
+
@page = @agent.get("http://localhost/form_select.html")
|
14
7
|
@form = @page.forms.first
|
15
8
|
end
|
16
9
|
|
@@ -25,7 +18,7 @@ class SelectTest < Test::Unit::TestCase
|
|
25
18
|
end
|
26
19
|
|
27
20
|
def test_correct_class
|
28
|
-
assert_instance_of(WWW::Mechanize::SelectList,
|
21
|
+
assert_instance_of(WWW::Mechanize::Form::SelectList,
|
29
22
|
@form.fields.name('list').first)
|
30
23
|
end
|
31
24
|
|
data/test/tc_select_all.rb
CHANGED
@@ -1,16 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'test/unit'
|
4
|
-
require 'rubygems'
|
5
|
-
require 'mechanize'
|
6
|
-
require 'test_includes'
|
7
|
-
|
1
|
+
require File.dirname(__FILE__) + "/helper"
|
8
2
|
class SelectAllTest < Test::Unit::TestCase
|
9
|
-
include TestMethods
|
10
|
-
|
11
3
|
def setup
|
12
4
|
@agent = WWW::Mechanize.new
|
13
|
-
@page = @agent.get("http://localhost
|
5
|
+
@page = @agent.get("http://localhost/form_select_all.html")
|
14
6
|
@form = @page.forms.first
|
15
7
|
end
|
16
8
|
|
data/test/tc_select_none.rb
CHANGED
@@ -1,16 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'test/unit'
|
4
|
-
require 'rubygems'
|
5
|
-
require 'mechanize'
|
6
|
-
require 'test_includes'
|
7
|
-
|
1
|
+
require File.dirname(__FILE__) + "/helper"
|
8
2
|
class SelectNoneTest < Test::Unit::TestCase
|
9
|
-
include TestMethods
|
10
|
-
|
11
3
|
def setup
|
12
4
|
@agent = WWW::Mechanize.new
|
13
|
-
@page = @agent.get("http://localhost
|
5
|
+
@page = @agent.get("http://localhost/form_select_none.html")
|
14
6
|
@form = @page.forms.first
|
15
7
|
end
|
16
8
|
|
data/test/tc_select_noopts.rb
CHANGED
@@ -1,16 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'test/unit'
|
4
|
-
require 'rubygems'
|
5
|
-
require 'mechanize'
|
6
|
-
require 'test_includes'
|
1
|
+
require File.dirname(__FILE__) + "/helper"
|
7
2
|
|
8
3
|
class SelectNoOptionsTest < Test::Unit::TestCase
|
9
|
-
include TestMethods
|
10
|
-
|
11
4
|
def setup
|
12
5
|
@agent = WWW::Mechanize.new
|
13
|
-
@page = @agent.get("http://localhost
|
6
|
+
@page = @agent.get("http://localhost/form_select_noopts.html")
|
14
7
|
@form = @page.forms.first
|
15
8
|
end
|
16
9
|
|