impuri 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG +8 -0
- data/ImpURI.gemspec +1 -2
- data/lib/ImpURI/VERSION.rb +1 -1
- data/test/ImpURI/class_methods.rb +426 -426
- data/test/ImpURI/instance_methods.rb +377 -377
- metadata +1 -15
|
@@ -5,14 +5,14 @@ gem 'minitest'
|
|
|
5
5
|
$LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'lib')))
|
|
6
6
|
|
|
7
7
|
require 'ImpURI'
|
|
8
|
-
require 'minitest/
|
|
8
|
+
require 'minitest/autorun'
|
|
9
9
|
|
|
10
10
|
describe ImpURI do
|
|
11
11
|
describe 'ImpURI class methods' do
|
|
12
12
|
|
|
13
13
|
describe 'parse()' do
|
|
14
14
|
it 'must return an object of class ImpURI' do
|
|
15
|
-
ImpURI.parse('http://example.com').class.must_equal ImpURI
|
|
15
|
+
_(ImpURI.parse('http://example.com').class).must_equal ImpURI
|
|
16
16
|
end
|
|
17
17
|
end
|
|
18
18
|
|
|
@@ -22,66 +22,66 @@ describe ImpURI do
|
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
it 'must parse out the scheme' do
|
|
25
|
-
ImpURI.scheme(@http_uri).must_equal 'http'
|
|
26
|
-
ImpURI.protocol(@http_uri).must_equal 'http'
|
|
27
|
-
ImpURI.scheme_name(@http_uri).must_equal 'http'
|
|
25
|
+
_(ImpURI.scheme(@http_uri)).must_equal 'http'
|
|
26
|
+
_(ImpURI.protocol(@http_uri)).must_equal 'http'
|
|
27
|
+
_(ImpURI.scheme_name(@http_uri)).must_equal 'http'
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
it 'must parse out the domain name' do
|
|
31
|
-
ImpURI.hostname(@http_uri).must_equal 'example.com'
|
|
32
|
-
ImpURI.host(@http_uri).must_equal 'example.com'
|
|
31
|
+
_(ImpURI.hostname(@http_uri)).must_equal 'example.com'
|
|
32
|
+
_(ImpURI.host(@http_uri)).must_equal 'example.com'
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
it 'must return nil if there is no path' do
|
|
36
|
-
ImpURI.path(@http_uri).must_be_nil
|
|
36
|
+
_(ImpURI.path(@http_uri)).must_be_nil
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
it 'must return nil if there are no GET request parameters' do
|
|
40
|
-
ImpURI.parameter_string(@http_uri).must_be_nil
|
|
41
|
-
ImpURI.parameters(@http_uri).must_be_nil
|
|
40
|
+
_(ImpURI.parameter_string(@http_uri)).must_be_nil
|
|
41
|
+
_(ImpURI.parameters(@http_uri)).must_be_nil
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
it 'must return false for has_userinfo?()' do
|
|
45
|
-
ImpURI.has_userinfo?(@http_uri).must_equal false
|
|
46
|
-
ImpURI.has_credentials?(@http_uri).must_equal false
|
|
47
|
-
ImpURI.has_username_and_password?(@http_uri).must_equal false
|
|
48
|
-
ImpURI.has_user_info?(@http_uri).must_equal false
|
|
49
|
-
ImpURI.userinfo?(@http_uri).must_equal false
|
|
50
|
-
ImpURI.credentials?(@http_uri).must_equal false
|
|
51
|
-
ImpURI.username_and_password?(@http_uri).must_equal false
|
|
52
|
-
ImpURI.user_info?(@http_uri).must_equal false
|
|
45
|
+
_(ImpURI.has_userinfo?(@http_uri)).must_equal false
|
|
46
|
+
_(ImpURI.has_credentials?(@http_uri)).must_equal false
|
|
47
|
+
_(ImpURI.has_username_and_password?(@http_uri)).must_equal false
|
|
48
|
+
_(ImpURI.has_user_info?(@http_uri)).must_equal false
|
|
49
|
+
_(ImpURI.userinfo?(@http_uri)).must_equal false
|
|
50
|
+
_(ImpURI.credentials?(@http_uri)).must_equal false
|
|
51
|
+
_(ImpURI.username_and_password?(@http_uri)).must_equal false
|
|
52
|
+
_(ImpURI.user_info?(@http_uri)).must_equal false
|
|
53
53
|
end
|
|
54
54
|
|
|
55
55
|
it 'must return true for has_scheme?()' do
|
|
56
|
-
ImpURI.has_scheme?(@http_uri).must_equal true
|
|
57
|
-
ImpURI.has_protocol?(@http_uri).must_equal true
|
|
58
|
-
ImpURI.has_scheme_name?(@http_uri).must_equal true
|
|
59
|
-
ImpURI.scheme?(@http_uri).must_equal true
|
|
60
|
-
ImpURI.protocol?(@http_uri).must_equal true
|
|
61
|
-
ImpURI.scheme_name?(@http_uri).must_equal true
|
|
56
|
+
_(ImpURI.has_scheme?(@http_uri)).must_equal true
|
|
57
|
+
_(ImpURI.has_protocol?(@http_uri)).must_equal true
|
|
58
|
+
_(ImpURI.has_scheme_name?(@http_uri)).must_equal true
|
|
59
|
+
_(ImpURI.scheme?(@http_uri)).must_equal true
|
|
60
|
+
_(ImpURI.protocol?(@http_uri)).must_equal true
|
|
61
|
+
_(ImpURI.scheme_name?(@http_uri)).must_equal true
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
it 'must return false for has_colon_path_separator?()' do
|
|
65
|
-
ImpURI.colon_path_separator?(@http_uri).must_equal false
|
|
66
|
-
ImpURI.has_colon_path_separator?(@http_uri).must_equal false
|
|
67
|
-
ImpURI.uses_colon_path_separator?(@http_uri).must_equal false
|
|
65
|
+
_(ImpURI.colon_path_separator?(@http_uri)).must_equal false
|
|
66
|
+
_(ImpURI.has_colon_path_separator?(@http_uri)).must_equal false
|
|
67
|
+
_(ImpURI.uses_colon_path_separator?(@http_uri)).must_equal false
|
|
68
68
|
end
|
|
69
69
|
|
|
70
70
|
it 'must return false for has_port_number?()' do
|
|
71
|
-
ImpURI.has_port_number?(@http_uri).must_equal false
|
|
72
|
-
ImpURI.has_port?(@http_uri).must_equal false
|
|
73
|
-
ImpURI.has_portnumber?(@http_uri).must_equal false
|
|
74
|
-
ImpURI.port_number?(@http_uri).must_equal false
|
|
75
|
-
ImpURI.port?(@http_uri).must_equal false
|
|
76
|
-
ImpURI.portnumber?(@http_uri).must_equal false
|
|
71
|
+
_(ImpURI.has_port_number?(@http_uri)).must_equal false
|
|
72
|
+
_(ImpURI.has_port?(@http_uri)).must_equal false
|
|
73
|
+
_(ImpURI.has_portnumber?(@http_uri)).must_equal false
|
|
74
|
+
_(ImpURI.port_number?(@http_uri)).must_equal false
|
|
75
|
+
_(ImpURI.port?(@http_uri)).must_equal false
|
|
76
|
+
_(ImpURI.portnumber?(@http_uri)).must_equal false
|
|
77
77
|
end
|
|
78
78
|
|
|
79
79
|
it 'must return false for is_ssh?()' do
|
|
80
|
-
ImpURI.is_ssh?(@http_uri).must_equal false
|
|
80
|
+
_(ImpURI.is_ssh?(@http_uri)).must_equal false
|
|
81
81
|
end
|
|
82
82
|
|
|
83
83
|
it 'must return nil if there is no request URI' do
|
|
84
|
-
ImpURI.request_uri(@http_uri).must_be_nil
|
|
84
|
+
_(ImpURI.request_uri(@http_uri)).must_be_nil
|
|
85
85
|
end
|
|
86
86
|
end # describe 'a very simple http URI'
|
|
87
87
|
|
|
@@ -91,72 +91,72 @@ describe ImpURI do
|
|
|
91
91
|
end
|
|
92
92
|
|
|
93
93
|
it 'must parse out the scheme' do
|
|
94
|
-
ImpURI.scheme(@http_uri).must_equal 'http'
|
|
95
|
-
ImpURI.protocol(@http_uri).must_equal 'http'
|
|
96
|
-
ImpURI.scheme_name(@http_uri).must_equal 'http'
|
|
94
|
+
_(ImpURI.scheme(@http_uri)).must_equal 'http'
|
|
95
|
+
_(ImpURI.protocol(@http_uri)).must_equal 'http'
|
|
96
|
+
_(ImpURI.scheme_name(@http_uri)).must_equal 'http'
|
|
97
97
|
end
|
|
98
98
|
|
|
99
99
|
it 'must parse out the domain name' do
|
|
100
|
-
ImpURI.hostname(@http_uri).must_equal 'example.com'
|
|
101
|
-
ImpURI.host(@http_uri).must_equal 'example.com'
|
|
100
|
+
_(ImpURI.hostname(@http_uri)).must_equal 'example.com'
|
|
101
|
+
_(ImpURI.host(@http_uri)).must_equal 'example.com'
|
|
102
102
|
end
|
|
103
103
|
|
|
104
104
|
it 'must return nil if there is no path' do
|
|
105
|
-
ImpURI.path(@http_uri).must_be_nil
|
|
105
|
+
_(ImpURI.path(@http_uri)).must_be_nil
|
|
106
106
|
end
|
|
107
107
|
|
|
108
108
|
it 'must parse out the port number' do
|
|
109
|
-
ImpURI.port(@http_uri).must_equal '8080'
|
|
110
|
-
ImpURI.portnumber(@http_uri).must_equal '8080'
|
|
111
|
-
ImpURI.port_number(@http_uri).must_equal '8080'
|
|
109
|
+
_(ImpURI.port(@http_uri)).must_equal '8080'
|
|
110
|
+
_(ImpURI.portnumber(@http_uri)).must_equal '8080'
|
|
111
|
+
_(ImpURI.port_number(@http_uri)).must_equal '8080'
|
|
112
112
|
end
|
|
113
113
|
|
|
114
114
|
it 'must return nil if there are no GET request parameters' do
|
|
115
|
-
ImpURI.parameter_string(@http_uri).must_be_nil
|
|
116
|
-
ImpURI.parameters(@http_uri).must_be_nil
|
|
115
|
+
_(ImpURI.parameter_string(@http_uri)).must_be_nil
|
|
116
|
+
_(ImpURI.parameters(@http_uri)).must_be_nil
|
|
117
117
|
end
|
|
118
118
|
|
|
119
119
|
it 'must return false for has_userinfo?()' do
|
|
120
|
-
ImpURI.has_userinfo?(@http_uri).must_equal false
|
|
121
|
-
ImpURI.has_credentials?(@http_uri).must_equal false
|
|
122
|
-
ImpURI.has_username_and_password?(@http_uri).must_equal false
|
|
123
|
-
ImpURI.has_user_info?(@http_uri).must_equal false
|
|
124
|
-
ImpURI.userinfo?(@http_uri).must_equal false
|
|
125
|
-
ImpURI.credentials?(@http_uri).must_equal false
|
|
126
|
-
ImpURI.username_and_password?(@http_uri).must_equal false
|
|
127
|
-
ImpURI.user_info?(@http_uri).must_equal false
|
|
120
|
+
_(ImpURI.has_userinfo?(@http_uri)).must_equal false
|
|
121
|
+
_(ImpURI.has_credentials?(@http_uri)).must_equal false
|
|
122
|
+
_(ImpURI.has_username_and_password?(@http_uri)).must_equal false
|
|
123
|
+
_(ImpURI.has_user_info?(@http_uri)).must_equal false
|
|
124
|
+
_(ImpURI.userinfo?(@http_uri)).must_equal false
|
|
125
|
+
_(ImpURI.credentials?(@http_uri)).must_equal false
|
|
126
|
+
_(ImpURI.username_and_password?(@http_uri)).must_equal false
|
|
127
|
+
_(ImpURI.user_info?(@http_uri)).must_equal false
|
|
128
128
|
end
|
|
129
129
|
|
|
130
130
|
it 'must return true for has_scheme?()' do
|
|
131
|
-
ImpURI.has_scheme?(@http_uri).must_equal true
|
|
132
|
-
ImpURI.has_protocol?(@http_uri).must_equal true
|
|
133
|
-
ImpURI.has_scheme_name?(@http_uri).must_equal true
|
|
134
|
-
ImpURI.scheme?(@http_uri).must_equal true
|
|
135
|
-
ImpURI.protocol?(@http_uri).must_equal true
|
|
136
|
-
ImpURI.scheme_name?(@http_uri).must_equal true
|
|
131
|
+
_(ImpURI.has_scheme?(@http_uri)).must_equal true
|
|
132
|
+
_(ImpURI.has_protocol?(@http_uri)).must_equal true
|
|
133
|
+
_(ImpURI.has_scheme_name?(@http_uri)).must_equal true
|
|
134
|
+
_(ImpURI.scheme?(@http_uri)).must_equal true
|
|
135
|
+
_(ImpURI.protocol?(@http_uri)).must_equal true
|
|
136
|
+
_(ImpURI.scheme_name?(@http_uri)).must_equal true
|
|
137
137
|
end
|
|
138
138
|
|
|
139
139
|
it 'must return false for has_colon_path_separator?()' do
|
|
140
|
-
ImpURI.colon_path_separator?(@http_uri).must_equal false
|
|
141
|
-
ImpURI.has_colon_path_separator?(@http_uri).must_equal false
|
|
142
|
-
ImpURI.uses_colon_path_separator?(@http_uri).must_equal false
|
|
140
|
+
_(ImpURI.colon_path_separator?(@http_uri)).must_equal false
|
|
141
|
+
_(ImpURI.has_colon_path_separator?(@http_uri)).must_equal false
|
|
142
|
+
_(ImpURI.uses_colon_path_separator?(@http_uri)).must_equal false
|
|
143
143
|
end
|
|
144
144
|
|
|
145
145
|
it 'must return true for has_port_number?()' do
|
|
146
|
-
ImpURI.has_port_number?(@http_uri).must_equal true
|
|
147
|
-
ImpURI.has_port?(@http_uri).must_equal true
|
|
148
|
-
ImpURI.has_portnumber?(@http_uri).must_equal true
|
|
149
|
-
ImpURI.port_number?(@http_uri).must_equal true
|
|
150
|
-
ImpURI.port?(@http_uri).must_equal true
|
|
151
|
-
ImpURI.portnumber?(@http_uri).must_equal true
|
|
146
|
+
_(ImpURI.has_port_number?(@http_uri)).must_equal true
|
|
147
|
+
_(ImpURI.has_port?(@http_uri)).must_equal true
|
|
148
|
+
_(ImpURI.has_portnumber?(@http_uri)).must_equal true
|
|
149
|
+
_(ImpURI.port_number?(@http_uri)).must_equal true
|
|
150
|
+
_(ImpURI.port?(@http_uri)).must_equal true
|
|
151
|
+
_(ImpURI.portnumber?(@http_uri)).must_equal true
|
|
152
152
|
end
|
|
153
153
|
|
|
154
154
|
it 'must return false for is_ssh?()' do
|
|
155
|
-
ImpURI.is_ssh?(@http_uri).must_equal false
|
|
155
|
+
_(ImpURI.is_ssh?(@http_uri)).must_equal false
|
|
156
156
|
end
|
|
157
157
|
|
|
158
158
|
it 'must return nil if there is no request URI' do
|
|
159
|
-
ImpURI.request_uri(@http_uri).must_be_nil
|
|
159
|
+
_(ImpURI.request_uri(@http_uri)).must_be_nil
|
|
160
160
|
end
|
|
161
161
|
end # describe 'an http URI with a port number'
|
|
162
162
|
|
|
@@ -166,66 +166,66 @@ describe ImpURI do
|
|
|
166
166
|
end
|
|
167
167
|
|
|
168
168
|
it 'must parse out the scheme' do
|
|
169
|
-
ImpURI.scheme(@http_uri).must_equal 'http'
|
|
170
|
-
ImpURI.protocol(@http_uri).must_equal 'http'
|
|
171
|
-
ImpURI.scheme_name(@http_uri).must_equal 'http'
|
|
169
|
+
_(ImpURI.scheme(@http_uri)).must_equal 'http'
|
|
170
|
+
_(ImpURI.protocol(@http_uri)).must_equal 'http'
|
|
171
|
+
_(ImpURI.scheme_name(@http_uri)).must_equal 'http'
|
|
172
172
|
end
|
|
173
173
|
|
|
174
174
|
it 'must parse out the domain name' do
|
|
175
|
-
ImpURI.hostname(@http_uri).must_equal 'example.com'
|
|
176
|
-
ImpURI.host(@http_uri).must_equal 'example.com'
|
|
175
|
+
_(ImpURI.hostname(@http_uri)).must_equal 'example.com'
|
|
176
|
+
_(ImpURI.host(@http_uri)).must_equal 'example.com'
|
|
177
177
|
end
|
|
178
178
|
|
|
179
179
|
it 'must parse out the path' do
|
|
180
|
-
ImpURI.path(@http_uri).must_equal '/path/to/resource'
|
|
180
|
+
_(ImpURI.path(@http_uri)).must_equal '/path/to/resource'
|
|
181
181
|
end
|
|
182
182
|
|
|
183
183
|
it 'must return nil if there are no GET request parameters' do
|
|
184
|
-
ImpURI.parameter_string(@http_uri).must_be_nil
|
|
185
|
-
ImpURI.parameters(@http_uri).must_be_nil
|
|
184
|
+
_(ImpURI.parameter_string(@http_uri)).must_be_nil
|
|
185
|
+
_(ImpURI.parameters(@http_uri)).must_be_nil
|
|
186
186
|
end
|
|
187
187
|
|
|
188
188
|
it 'must return false for has_userinfo?()' do
|
|
189
|
-
ImpURI.has_userinfo?(@http_uri).must_equal false
|
|
190
|
-
ImpURI.has_credentials?(@http_uri).must_equal false
|
|
191
|
-
ImpURI.has_username_and_password?(@http_uri).must_equal false
|
|
192
|
-
ImpURI.has_user_info?(@http_uri).must_equal false
|
|
193
|
-
ImpURI.userinfo?(@http_uri).must_equal false
|
|
194
|
-
ImpURI.credentials?(@http_uri).must_equal false
|
|
195
|
-
ImpURI.username_and_password?(@http_uri).must_equal false
|
|
196
|
-
ImpURI.user_info?(@http_uri).must_equal false
|
|
189
|
+
_(ImpURI.has_userinfo?(@http_uri)).must_equal false
|
|
190
|
+
_(ImpURI.has_credentials?(@http_uri)).must_equal false
|
|
191
|
+
_(ImpURI.has_username_and_password?(@http_uri)).must_equal false
|
|
192
|
+
_(ImpURI.has_user_info?(@http_uri)).must_equal false
|
|
193
|
+
_(ImpURI.userinfo?(@http_uri)).must_equal false
|
|
194
|
+
_(ImpURI.credentials?(@http_uri)).must_equal false
|
|
195
|
+
_(ImpURI.username_and_password?(@http_uri)).must_equal false
|
|
196
|
+
_(ImpURI.user_info?(@http_uri)).must_equal false
|
|
197
197
|
end
|
|
198
198
|
|
|
199
199
|
it 'must return true for has_scheme?()' do
|
|
200
|
-
ImpURI.has_scheme?(@http_uri).must_equal true
|
|
201
|
-
ImpURI.has_protocol?(@http_uri).must_equal true
|
|
202
|
-
ImpURI.has_scheme_name?(@http_uri).must_equal true
|
|
203
|
-
ImpURI.scheme?(@http_uri).must_equal true
|
|
204
|
-
ImpURI.protocol?(@http_uri).must_equal true
|
|
205
|
-
ImpURI.scheme_name?(@http_uri).must_equal true
|
|
200
|
+
_(ImpURI.has_scheme?(@http_uri)).must_equal true
|
|
201
|
+
_(ImpURI.has_protocol?(@http_uri)).must_equal true
|
|
202
|
+
_(ImpURI.has_scheme_name?(@http_uri)).must_equal true
|
|
203
|
+
_(ImpURI.scheme?(@http_uri)).must_equal true
|
|
204
|
+
_(ImpURI.protocol?(@http_uri)).must_equal true
|
|
205
|
+
_(ImpURI.scheme_name?(@http_uri)).must_equal true
|
|
206
206
|
end
|
|
207
207
|
|
|
208
208
|
it 'must return false for has_colon_path_separator?()' do
|
|
209
|
-
ImpURI.colon_path_separator?(@http_uri).must_equal false
|
|
210
|
-
ImpURI.has_colon_path_separator?(@http_uri).must_equal false
|
|
211
|
-
ImpURI.uses_colon_path_separator?(@http_uri).must_equal false
|
|
209
|
+
_(ImpURI.colon_path_separator?(@http_uri)).must_equal false
|
|
210
|
+
_(ImpURI.has_colon_path_separator?(@http_uri)).must_equal false
|
|
211
|
+
_(ImpURI.uses_colon_path_separator?(@http_uri)).must_equal false
|
|
212
212
|
end
|
|
213
213
|
|
|
214
214
|
it 'must return false for has_port_number?()' do
|
|
215
|
-
ImpURI.has_port_number?(@http_uri).must_equal false
|
|
216
|
-
ImpURI.has_port?(@http_uri).must_equal false
|
|
217
|
-
ImpURI.has_portnumber?(@http_uri).must_equal false
|
|
218
|
-
ImpURI.port_number?(@http_uri).must_equal false
|
|
219
|
-
ImpURI.port?(@http_uri).must_equal false
|
|
220
|
-
ImpURI.portnumber?(@http_uri).must_equal false
|
|
215
|
+
_(ImpURI.has_port_number?(@http_uri)).must_equal false
|
|
216
|
+
_(ImpURI.has_port?(@http_uri)).must_equal false
|
|
217
|
+
_(ImpURI.has_portnumber?(@http_uri)).must_equal false
|
|
218
|
+
_(ImpURI.port_number?(@http_uri)).must_equal false
|
|
219
|
+
_(ImpURI.port?(@http_uri)).must_equal false
|
|
220
|
+
_(ImpURI.portnumber?(@http_uri)).must_equal false
|
|
221
221
|
end
|
|
222
222
|
|
|
223
223
|
it 'must return false for is_ssh?()' do
|
|
224
|
-
ImpURI.is_ssh?(@http_uri).must_equal false
|
|
224
|
+
_(ImpURI.is_ssh?(@http_uri)).must_equal false
|
|
225
225
|
end
|
|
226
226
|
|
|
227
227
|
it 'must return the request URI' do
|
|
228
|
-
ImpURI.request_uri(@http_uri).must_equal '/path/to/resource'
|
|
228
|
+
_(ImpURI.request_uri(@http_uri)).must_equal '/path/to/resource'
|
|
229
229
|
end
|
|
230
230
|
end # describe 'an http URI with a path'
|
|
231
231
|
|
|
@@ -235,73 +235,73 @@ describe ImpURI do
|
|
|
235
235
|
end
|
|
236
236
|
|
|
237
237
|
it 'must parse out the scheme' do
|
|
238
|
-
ImpURI.scheme(@http_uri).must_equal 'http'
|
|
239
|
-
ImpURI.protocol(@http_uri).must_equal 'http'
|
|
240
|
-
ImpURI.scheme_name(@http_uri).must_equal 'http'
|
|
238
|
+
_(ImpURI.scheme(@http_uri)).must_equal 'http'
|
|
239
|
+
_(ImpURI.protocol(@http_uri)).must_equal 'http'
|
|
240
|
+
_(ImpURI.scheme_name(@http_uri)).must_equal 'http'
|
|
241
241
|
end
|
|
242
242
|
|
|
243
243
|
it 'must parse out the domain name' do
|
|
244
|
-
ImpURI.hostname(@http_uri).must_equal 'example.com'
|
|
245
|
-
ImpURI.host(@http_uri).must_equal 'example.com'
|
|
244
|
+
_(ImpURI.hostname(@http_uri)).must_equal 'example.com'
|
|
245
|
+
_(ImpURI.host(@http_uri)).must_equal 'example.com'
|
|
246
246
|
end
|
|
247
247
|
|
|
248
248
|
it 'must parse out the username' do
|
|
249
|
-
ImpURI.username(@http_uri).must_equal 'user'
|
|
249
|
+
_(ImpURI.username(@http_uri)).must_equal 'user'
|
|
250
250
|
end
|
|
251
251
|
|
|
252
252
|
it 'must return the userinfo string' do
|
|
253
|
-
ImpURI.userinfo(@http_uri).must_equal 'user'
|
|
254
|
-
ImpURI.credentials(@http_uri).must_equal 'user'
|
|
255
|
-
ImpURI.username_and_password(@http_uri).must_equal 'user'
|
|
256
|
-
ImpURI.user_info(@http_uri).must_equal 'user'
|
|
253
|
+
_(ImpURI.userinfo(@http_uri)).must_equal 'user'
|
|
254
|
+
_(ImpURI.credentials(@http_uri)).must_equal 'user'
|
|
255
|
+
_(ImpURI.username_and_password(@http_uri)).must_equal 'user'
|
|
256
|
+
_(ImpURI.user_info(@http_uri)).must_equal 'user'
|
|
257
257
|
end
|
|
258
258
|
|
|
259
259
|
it 'must return nil if there are no GET request parameters' do
|
|
260
|
-
ImpURI.parameter_string(@http_uri).must_be_nil
|
|
261
|
-
ImpURI.parameters(@http_uri).must_be_nil
|
|
260
|
+
_(ImpURI.parameter_string(@http_uri)).must_be_nil
|
|
261
|
+
_(ImpURI.parameters(@http_uri)).must_be_nil
|
|
262
262
|
end
|
|
263
263
|
|
|
264
264
|
it 'must return true for has_userinfo?()' do
|
|
265
|
-
ImpURI.has_userinfo?(@http_uri).must_equal true
|
|
266
|
-
ImpURI.has_credentials?(@http_uri).must_equal true
|
|
267
|
-
ImpURI.has_username_and_password?(@http_uri).must_equal true
|
|
268
|
-
ImpURI.has_user_info?(@http_uri).must_equal true
|
|
269
|
-
ImpURI.userinfo?(@http_uri).must_equal true
|
|
270
|
-
ImpURI.credentials?(@http_uri).must_equal true
|
|
271
|
-
ImpURI.username_and_password?(@http_uri).must_equal true
|
|
272
|
-
ImpURI.user_info?(@http_uri).must_equal true
|
|
265
|
+
_(ImpURI.has_userinfo?(@http_uri)).must_equal true
|
|
266
|
+
_(ImpURI.has_credentials?(@http_uri)).must_equal true
|
|
267
|
+
_(ImpURI.has_username_and_password?(@http_uri)).must_equal true
|
|
268
|
+
_(ImpURI.has_user_info?(@http_uri)).must_equal true
|
|
269
|
+
_(ImpURI.userinfo?(@http_uri)).must_equal true
|
|
270
|
+
_(ImpURI.credentials?(@http_uri)).must_equal true
|
|
271
|
+
_(ImpURI.username_and_password?(@http_uri)).must_equal true
|
|
272
|
+
_(ImpURI.user_info?(@http_uri)).must_equal true
|
|
273
273
|
end
|
|
274
274
|
|
|
275
275
|
it 'must return true for has_scheme?()' do
|
|
276
|
-
ImpURI.has_scheme?(@http_uri).must_equal true
|
|
277
|
-
ImpURI.has_protocol?(@http_uri).must_equal true
|
|
278
|
-
ImpURI.has_scheme_name?(@http_uri).must_equal true
|
|
279
|
-
ImpURI.scheme?(@http_uri).must_equal true
|
|
280
|
-
ImpURI.protocol?(@http_uri).must_equal true
|
|
281
|
-
ImpURI.scheme_name?(@http_uri).must_equal true
|
|
276
|
+
_(ImpURI.has_scheme?(@http_uri)).must_equal true
|
|
277
|
+
_(ImpURI.has_protocol?(@http_uri)).must_equal true
|
|
278
|
+
_(ImpURI.has_scheme_name?(@http_uri)).must_equal true
|
|
279
|
+
_(ImpURI.scheme?(@http_uri)).must_equal true
|
|
280
|
+
_(ImpURI.protocol?(@http_uri)).must_equal true
|
|
281
|
+
_(ImpURI.scheme_name?(@http_uri)).must_equal true
|
|
282
282
|
end
|
|
283
283
|
|
|
284
284
|
it 'must return false for has_colon_path_separator?()' do
|
|
285
|
-
ImpURI.colon_path_separator?(@http_uri).must_equal false
|
|
286
|
-
ImpURI.has_colon_path_separator?(@http_uri).must_equal false
|
|
287
|
-
ImpURI.uses_colon_path_separator?(@http_uri).must_equal false
|
|
285
|
+
_(ImpURI.colon_path_separator?(@http_uri)).must_equal false
|
|
286
|
+
_(ImpURI.has_colon_path_separator?(@http_uri)).must_equal false
|
|
287
|
+
_(ImpURI.uses_colon_path_separator?(@http_uri)).must_equal false
|
|
288
288
|
end
|
|
289
289
|
|
|
290
290
|
it 'must return false for has_port_number?()' do
|
|
291
|
-
ImpURI.has_port_number?(@http_uri).must_equal false
|
|
292
|
-
ImpURI.has_port?(@http_uri).must_equal false
|
|
293
|
-
ImpURI.has_portnumber?(@http_uri).must_equal false
|
|
294
|
-
ImpURI.port_number?(@http_uri).must_equal false
|
|
295
|
-
ImpURI.port?(@http_uri).must_equal false
|
|
296
|
-
ImpURI.portnumber?(@http_uri).must_equal false
|
|
291
|
+
_(ImpURI.has_port_number?(@http_uri)).must_equal false
|
|
292
|
+
_(ImpURI.has_port?(@http_uri)).must_equal false
|
|
293
|
+
_(ImpURI.has_portnumber?(@http_uri)).must_equal false
|
|
294
|
+
_(ImpURI.port_number?(@http_uri)).must_equal false
|
|
295
|
+
_(ImpURI.port?(@http_uri)).must_equal false
|
|
296
|
+
_(ImpURI.portnumber?(@http_uri)).must_equal false
|
|
297
297
|
end
|
|
298
298
|
|
|
299
299
|
it 'must return false for is_ssh?()' do
|
|
300
|
-
ImpURI.is_ssh?(@http_uri).must_equal false
|
|
300
|
+
_(ImpURI.is_ssh?(@http_uri)).must_equal false
|
|
301
301
|
end
|
|
302
302
|
|
|
303
303
|
it 'must return nil if there is no request URI' do
|
|
304
|
-
ImpURI.request_uri(@http_uri).must_be_nil
|
|
304
|
+
_(ImpURI.request_uri(@http_uri)).must_be_nil
|
|
305
305
|
end
|
|
306
306
|
end # describe 'an http URI with a username'
|
|
307
307
|
|
|
@@ -311,80 +311,80 @@ describe ImpURI do
|
|
|
311
311
|
end
|
|
312
312
|
|
|
313
313
|
it 'must parse out the scheme' do
|
|
314
|
-
ImpURI.scheme(@http_uri).must_equal 'http'
|
|
315
|
-
ImpURI.protocol(@http_uri).must_equal 'http'
|
|
316
|
-
ImpURI.scheme_name(@http_uri).must_equal 'http'
|
|
314
|
+
_(ImpURI.scheme(@http_uri)).must_equal 'http'
|
|
315
|
+
_(ImpURI.protocol(@http_uri)).must_equal 'http'
|
|
316
|
+
_(ImpURI.scheme_name(@http_uri)).must_equal 'http'
|
|
317
317
|
end
|
|
318
318
|
|
|
319
319
|
it 'must parse out the domain name' do
|
|
320
|
-
ImpURI.hostname(@http_uri).must_equal 'example.com'
|
|
321
|
-
ImpURI.host(@http_uri).must_equal 'example.com'
|
|
320
|
+
_(ImpURI.hostname(@http_uri)).must_equal 'example.com'
|
|
321
|
+
_(ImpURI.host(@http_uri)).must_equal 'example.com'
|
|
322
322
|
end
|
|
323
323
|
|
|
324
324
|
it 'must parse out the username' do
|
|
325
|
-
ImpURI.username(@http_uri).must_equal 'user'
|
|
326
|
-
ImpURI.user(@http_uri).must_equal 'user'
|
|
325
|
+
_(ImpURI.username(@http_uri)).must_equal 'user'
|
|
326
|
+
_(ImpURI.user(@http_uri)).must_equal 'user'
|
|
327
327
|
end
|
|
328
328
|
|
|
329
329
|
it 'must parse out the password' do
|
|
330
|
-
ImpURI.password(@http_uri).must_equal 'pass'
|
|
331
|
-
ImpURI.pass(@http_uri).must_equal 'pass'
|
|
332
|
-
ImpURI.passwd(@http_uri).must_equal 'pass'
|
|
330
|
+
_(ImpURI.password(@http_uri)).must_equal 'pass'
|
|
331
|
+
_(ImpURI.pass(@http_uri)).must_equal 'pass'
|
|
332
|
+
_(ImpURI.passwd(@http_uri)).must_equal 'pass'
|
|
333
333
|
end
|
|
334
334
|
|
|
335
335
|
it 'must return the userinfo string' do
|
|
336
|
-
ImpURI.userinfo(@http_uri).must_equal 'user:pass'
|
|
337
|
-
ImpURI.credentials(@http_uri).must_equal 'user:pass'
|
|
338
|
-
ImpURI.username_and_password(@http_uri).must_equal 'user:pass'
|
|
339
|
-
ImpURI.user_info(@http_uri).must_equal 'user:pass'
|
|
336
|
+
_(ImpURI.userinfo(@http_uri)).must_equal 'user:pass'
|
|
337
|
+
_(ImpURI.credentials(@http_uri)).must_equal 'user:pass'
|
|
338
|
+
_(ImpURI.username_and_password(@http_uri)).must_equal 'user:pass'
|
|
339
|
+
_(ImpURI.user_info(@http_uri)).must_equal 'user:pass'
|
|
340
340
|
end
|
|
341
341
|
|
|
342
342
|
it 'must return nil if there are no GET request parameters' do
|
|
343
|
-
ImpURI.parameter_string(@http_uri).must_be_nil
|
|
344
|
-
ImpURI.parameters(@http_uri).must_be_nil
|
|
343
|
+
_(ImpURI.parameter_string(@http_uri)).must_be_nil
|
|
344
|
+
_(ImpURI.parameters(@http_uri)).must_be_nil
|
|
345
345
|
end
|
|
346
346
|
|
|
347
347
|
it 'must return true for has_userinfo?()' do
|
|
348
|
-
ImpURI.has_userinfo?(@http_uri).must_equal true
|
|
349
|
-
ImpURI.has_credentials?(@http_uri).must_equal true
|
|
350
|
-
ImpURI.has_username_and_password?(@http_uri).must_equal true
|
|
351
|
-
ImpURI.has_user_info?(@http_uri).must_equal true
|
|
352
|
-
ImpURI.userinfo?(@http_uri).must_equal true
|
|
353
|
-
ImpURI.credentials?(@http_uri).must_equal true
|
|
354
|
-
ImpURI.username_and_password?(@http_uri).must_equal true
|
|
355
|
-
ImpURI.user_info?(@http_uri).must_equal true
|
|
348
|
+
_(ImpURI.has_userinfo?(@http_uri)).must_equal true
|
|
349
|
+
_(ImpURI.has_credentials?(@http_uri)).must_equal true
|
|
350
|
+
_(ImpURI.has_username_and_password?(@http_uri)).must_equal true
|
|
351
|
+
_(ImpURI.has_user_info?(@http_uri)).must_equal true
|
|
352
|
+
_(ImpURI.userinfo?(@http_uri)).must_equal true
|
|
353
|
+
_(ImpURI.credentials?(@http_uri)).must_equal true
|
|
354
|
+
_(ImpURI.username_and_password?(@http_uri)).must_equal true
|
|
355
|
+
_(ImpURI.user_info?(@http_uri)).must_equal true
|
|
356
356
|
end
|
|
357
357
|
|
|
358
358
|
it 'must return true for has_scheme?()' do
|
|
359
|
-
ImpURI.has_scheme?(@http_uri).must_equal true
|
|
360
|
-
ImpURI.has_protocol?(@http_uri).must_equal true
|
|
361
|
-
ImpURI.has_scheme_name?(@http_uri).must_equal true
|
|
362
|
-
ImpURI.scheme?(@http_uri).must_equal true
|
|
363
|
-
ImpURI.protocol?(@http_uri).must_equal true
|
|
364
|
-
ImpURI.scheme_name?(@http_uri).must_equal true
|
|
359
|
+
_(ImpURI.has_scheme?(@http_uri)).must_equal true
|
|
360
|
+
_(ImpURI.has_protocol?(@http_uri)).must_equal true
|
|
361
|
+
_(ImpURI.has_scheme_name?(@http_uri)).must_equal true
|
|
362
|
+
_(ImpURI.scheme?(@http_uri)).must_equal true
|
|
363
|
+
_(ImpURI.protocol?(@http_uri)).must_equal true
|
|
364
|
+
_(ImpURI.scheme_name?(@http_uri)).must_equal true
|
|
365
365
|
end
|
|
366
366
|
|
|
367
367
|
it 'must return false for has_colon_path_separator?()' do
|
|
368
|
-
ImpURI.colon_path_separator?(@http_uri).must_equal false
|
|
369
|
-
ImpURI.has_colon_path_separator?(@http_uri).must_equal false
|
|
370
|
-
ImpURI.uses_colon_path_separator?(@http_uri).must_equal false
|
|
368
|
+
_(ImpURI.colon_path_separator?(@http_uri)).must_equal false
|
|
369
|
+
_(ImpURI.has_colon_path_separator?(@http_uri)).must_equal false
|
|
370
|
+
_(ImpURI.uses_colon_path_separator?(@http_uri)).must_equal false
|
|
371
371
|
end
|
|
372
372
|
|
|
373
373
|
it 'must return false for has_port_number?()' do
|
|
374
|
-
ImpURI.has_port_number?(@http_uri).must_equal false
|
|
375
|
-
ImpURI.has_port?(@http_uri).must_equal false
|
|
376
|
-
ImpURI.has_portnumber?(@http_uri).must_equal false
|
|
377
|
-
ImpURI.port_number?(@http_uri).must_equal false
|
|
378
|
-
ImpURI.port?(@http_uri).must_equal false
|
|
379
|
-
ImpURI.portnumber?(@http_uri).must_equal false
|
|
374
|
+
_(ImpURI.has_port_number?(@http_uri)).must_equal false
|
|
375
|
+
_(ImpURI.has_port?(@http_uri)).must_equal false
|
|
376
|
+
_(ImpURI.has_portnumber?(@http_uri)).must_equal false
|
|
377
|
+
_(ImpURI.port_number?(@http_uri)).must_equal false
|
|
378
|
+
_(ImpURI.port?(@http_uri)).must_equal false
|
|
379
|
+
_(ImpURI.portnumber?(@http_uri)).must_equal false
|
|
380
380
|
end
|
|
381
381
|
|
|
382
382
|
it 'must return false for is_ssh?()' do
|
|
383
|
-
ImpURI.is_ssh?(@http_uri).must_equal false
|
|
383
|
+
_(ImpURI.is_ssh?(@http_uri)).must_equal false
|
|
384
384
|
end
|
|
385
385
|
|
|
386
386
|
it 'must return nil if there is no request URI' do
|
|
387
|
-
ImpURI.request_uri(@http_uri).must_be_nil
|
|
387
|
+
_(ImpURI.request_uri(@http_uri)).must_be_nil
|
|
388
388
|
end
|
|
389
389
|
end # describe 'an http URI with a username and password'
|
|
390
390
|
|
|
@@ -394,65 +394,65 @@ describe ImpURI do
|
|
|
394
394
|
end
|
|
395
395
|
|
|
396
396
|
it 'must parse out the scheme' do
|
|
397
|
-
ImpURI.scheme(@http_uri).must_equal 'http'
|
|
398
|
-
ImpURI.protocol(@http_uri).must_equal 'http'
|
|
399
|
-
ImpURI.scheme_name(@http_uri).must_equal 'http'
|
|
397
|
+
_(ImpURI.scheme(@http_uri)).must_equal 'http'
|
|
398
|
+
_(ImpURI.protocol(@http_uri)).must_equal 'http'
|
|
399
|
+
_(ImpURI.scheme_name(@http_uri)).must_equal 'http'
|
|
400
400
|
end
|
|
401
401
|
|
|
402
402
|
it 'must parse out the domain name' do
|
|
403
|
-
ImpURI.hostname(@http_uri).must_equal 'example.com'
|
|
404
|
-
ImpURI.host(@http_uri).must_equal 'example.com'
|
|
403
|
+
_(ImpURI.hostname(@http_uri)).must_equal 'example.com'
|
|
404
|
+
_(ImpURI.host(@http_uri)).must_equal 'example.com'
|
|
405
405
|
end
|
|
406
406
|
|
|
407
407
|
it 'must parse out the paramter string' do
|
|
408
|
-
ImpURI.parameter_string(@http_uri).must_equal 'q=param'
|
|
408
|
+
_(ImpURI.parameter_string(@http_uri)).must_equal 'q=param'
|
|
409
409
|
end
|
|
410
410
|
|
|
411
411
|
it 'must parse out the parameter as a hash' do
|
|
412
|
-
ImpURI.parameters(@http_uri).must_equal({'q' => 'param'})
|
|
412
|
+
_(ImpURI.parameters(@http_uri)).must_equal({'q' => 'param'})
|
|
413
413
|
end
|
|
414
414
|
|
|
415
415
|
it 'must return false for has_userinfo?()' do
|
|
416
|
-
ImpURI.has_userinfo?(@http_uri).must_equal false
|
|
417
|
-
ImpURI.has_credentials?(@http_uri).must_equal false
|
|
418
|
-
ImpURI.has_username_and_password?(@http_uri).must_equal false
|
|
419
|
-
ImpURI.has_user_info?(@http_uri).must_equal false
|
|
420
|
-
ImpURI.userinfo?(@http_uri).must_equal false
|
|
421
|
-
ImpURI.credentials?(@http_uri).must_equal false
|
|
422
|
-
ImpURI.username_and_password?(@http_uri).must_equal false
|
|
423
|
-
ImpURI.user_info?(@http_uri).must_equal false
|
|
416
|
+
_(ImpURI.has_userinfo?(@http_uri)).must_equal false
|
|
417
|
+
_(ImpURI.has_credentials?(@http_uri)).must_equal false
|
|
418
|
+
_(ImpURI.has_username_and_password?(@http_uri)).must_equal false
|
|
419
|
+
_(ImpURI.has_user_info?(@http_uri)).must_equal false
|
|
420
|
+
_(ImpURI.userinfo?(@http_uri)).must_equal false
|
|
421
|
+
_(ImpURI.credentials?(@http_uri)).must_equal false
|
|
422
|
+
_(ImpURI.username_and_password?(@http_uri)).must_equal false
|
|
423
|
+
_(ImpURI.user_info?(@http_uri)).must_equal false
|
|
424
424
|
end
|
|
425
425
|
|
|
426
426
|
it 'must return true for has_scheme?()' do
|
|
427
|
-
ImpURI.has_scheme?(@http_uri).must_equal true
|
|
428
|
-
ImpURI.has_protocol?(@http_uri).must_equal true
|
|
429
|
-
ImpURI.has_scheme_name?(@http_uri).must_equal true
|
|
430
|
-
ImpURI.scheme?(@http_uri).must_equal true
|
|
431
|
-
ImpURI.protocol?(@http_uri).must_equal true
|
|
432
|
-
ImpURI.scheme_name?(@http_uri).must_equal true
|
|
427
|
+
_(ImpURI.has_scheme?(@http_uri)).must_equal true
|
|
428
|
+
_(ImpURI.has_protocol?(@http_uri)).must_equal true
|
|
429
|
+
_(ImpURI.has_scheme_name?(@http_uri)).must_equal true
|
|
430
|
+
_(ImpURI.scheme?(@http_uri)).must_equal true
|
|
431
|
+
_(ImpURI.protocol?(@http_uri)).must_equal true
|
|
432
|
+
_(ImpURI.scheme_name?(@http_uri)).must_equal true
|
|
433
433
|
end
|
|
434
434
|
|
|
435
435
|
it 'must return false for has_colon_path_separator?()' do
|
|
436
|
-
ImpURI.colon_path_separator?(@http_uri).must_equal false
|
|
437
|
-
ImpURI.has_colon_path_separator?(@http_uri).must_equal false
|
|
438
|
-
ImpURI.uses_colon_path_separator?(@http_uri).must_equal false
|
|
436
|
+
_(ImpURI.colon_path_separator?(@http_uri)).must_equal false
|
|
437
|
+
_(ImpURI.has_colon_path_separator?(@http_uri)).must_equal false
|
|
438
|
+
_(ImpURI.uses_colon_path_separator?(@http_uri)).must_equal false
|
|
439
439
|
end
|
|
440
440
|
|
|
441
441
|
it 'must return false for has_port_number?()' do
|
|
442
|
-
ImpURI.has_port_number?(@http_uri).must_equal false
|
|
443
|
-
ImpURI.has_port?(@http_uri).must_equal false
|
|
444
|
-
ImpURI.has_portnumber?(@http_uri).must_equal false
|
|
445
|
-
ImpURI.port_number?(@http_uri).must_equal false
|
|
446
|
-
ImpURI.port?(@http_uri).must_equal false
|
|
447
|
-
ImpURI.portnumber?(@http_uri).must_equal false
|
|
442
|
+
_(ImpURI.has_port_number?(@http_uri)).must_equal false
|
|
443
|
+
_(ImpURI.has_port?(@http_uri)).must_equal false
|
|
444
|
+
_(ImpURI.has_portnumber?(@http_uri)).must_equal false
|
|
445
|
+
_(ImpURI.port_number?(@http_uri)).must_equal false
|
|
446
|
+
_(ImpURI.port?(@http_uri)).must_equal false
|
|
447
|
+
_(ImpURI.portnumber?(@http_uri)).must_equal false
|
|
448
448
|
end
|
|
449
449
|
|
|
450
450
|
it 'must return false for is_ssh?()' do
|
|
451
|
-
ImpURI.is_ssh?(@http_uri).must_equal false
|
|
451
|
+
_(ImpURI.is_ssh?(@http_uri)).must_equal false
|
|
452
452
|
end
|
|
453
453
|
|
|
454
454
|
it 'must return the request URI' do
|
|
455
|
-
ImpURI.request_uri(@http_uri).must_equal '/?q=param'
|
|
455
|
+
_(ImpURI.request_uri(@http_uri)).must_equal '/?q=param'
|
|
456
456
|
end
|
|
457
457
|
end # describe 'an http URI with one GET query parameter'
|
|
458
458
|
|
|
@@ -462,65 +462,65 @@ describe ImpURI do
|
|
|
462
462
|
end
|
|
463
463
|
|
|
464
464
|
it 'must parse out the scheme' do
|
|
465
|
-
ImpURI.scheme(@http_uri).must_equal 'http'
|
|
466
|
-
ImpURI.protocol(@http_uri).must_equal 'http'
|
|
467
|
-
ImpURI.scheme_name(@http_uri).must_equal 'http'
|
|
465
|
+
_(ImpURI.scheme(@http_uri)).must_equal 'http'
|
|
466
|
+
_(ImpURI.protocol(@http_uri)).must_equal 'http'
|
|
467
|
+
_(ImpURI.scheme_name(@http_uri)).must_equal 'http'
|
|
468
468
|
end
|
|
469
469
|
|
|
470
470
|
it 'must parse out the domain name' do
|
|
471
|
-
ImpURI.hostname(@http_uri).must_equal 'example.com'
|
|
472
|
-
ImpURI.host(@http_uri).must_equal 'example.com'
|
|
471
|
+
_(ImpURI.hostname(@http_uri)).must_equal 'example.com'
|
|
472
|
+
_(ImpURI.host(@http_uri)).must_equal 'example.com'
|
|
473
473
|
end
|
|
474
474
|
|
|
475
475
|
it 'must parse out the paramter string' do
|
|
476
|
-
ImpURI.parameter_string(@http_uri).must_equal 'q=param1&r=param2'
|
|
476
|
+
_(ImpURI.parameter_string(@http_uri)).must_equal 'q=param1&r=param2'
|
|
477
477
|
end
|
|
478
478
|
|
|
479
479
|
it 'must parse out the parameter as a hash' do
|
|
480
|
-
ImpURI.parameters(@http_uri).must_equal({'q' => 'param1', 'r' => 'param2'})
|
|
480
|
+
_(ImpURI.parameters(@http_uri)).must_equal({'q' => 'param1', 'r' => 'param2'})
|
|
481
481
|
end
|
|
482
482
|
|
|
483
483
|
it 'must return false for has_userinfo?()' do
|
|
484
|
-
ImpURI.has_userinfo?(@http_uri).must_equal false
|
|
485
|
-
ImpURI.has_credentials?(@http_uri).must_equal false
|
|
486
|
-
ImpURI.has_username_and_password?(@http_uri).must_equal false
|
|
487
|
-
ImpURI.has_user_info?(@http_uri).must_equal false
|
|
488
|
-
ImpURI.userinfo?(@http_uri).must_equal false
|
|
489
|
-
ImpURI.credentials?(@http_uri).must_equal false
|
|
490
|
-
ImpURI.username_and_password?(@http_uri).must_equal false
|
|
491
|
-
ImpURI.user_info?(@http_uri).must_equal false
|
|
484
|
+
_(ImpURI.has_userinfo?(@http_uri)).must_equal false
|
|
485
|
+
_(ImpURI.has_credentials?(@http_uri)).must_equal false
|
|
486
|
+
_(ImpURI.has_username_and_password?(@http_uri)).must_equal false
|
|
487
|
+
_(ImpURI.has_user_info?(@http_uri)).must_equal false
|
|
488
|
+
_(ImpURI.userinfo?(@http_uri)).must_equal false
|
|
489
|
+
_(ImpURI.credentials?(@http_uri)).must_equal false
|
|
490
|
+
_(ImpURI.username_and_password?(@http_uri)).must_equal false
|
|
491
|
+
_(ImpURI.user_info?(@http_uri)).must_equal false
|
|
492
492
|
end
|
|
493
493
|
|
|
494
494
|
it 'must return true for has_scheme?()' do
|
|
495
|
-
ImpURI.has_scheme?(@http_uri).must_equal true
|
|
496
|
-
ImpURI.has_protocol?(@http_uri).must_equal true
|
|
497
|
-
ImpURI.has_scheme_name?(@http_uri).must_equal true
|
|
498
|
-
ImpURI.scheme?(@http_uri).must_equal true
|
|
499
|
-
ImpURI.protocol?(@http_uri).must_equal true
|
|
500
|
-
ImpURI.scheme_name?(@http_uri).must_equal true
|
|
495
|
+
_(ImpURI.has_scheme?(@http_uri)).must_equal true
|
|
496
|
+
_(ImpURI.has_protocol?(@http_uri)).must_equal true
|
|
497
|
+
_(ImpURI.has_scheme_name?(@http_uri)).must_equal true
|
|
498
|
+
_(ImpURI.scheme?(@http_uri)).must_equal true
|
|
499
|
+
_(ImpURI.protocol?(@http_uri)).must_equal true
|
|
500
|
+
_(ImpURI.scheme_name?(@http_uri)).must_equal true
|
|
501
501
|
end
|
|
502
502
|
|
|
503
503
|
it 'must return false for has_colon_path_separator?()' do
|
|
504
|
-
ImpURI.colon_path_separator?(@http_uri).must_equal false
|
|
505
|
-
ImpURI.has_colon_path_separator?(@http_uri).must_equal false
|
|
506
|
-
ImpURI.uses_colon_path_separator?(@http_uri).must_equal false
|
|
504
|
+
_(ImpURI.colon_path_separator?(@http_uri)).must_equal false
|
|
505
|
+
_(ImpURI.has_colon_path_separator?(@http_uri)).must_equal false
|
|
506
|
+
_(ImpURI.uses_colon_path_separator?(@http_uri)).must_equal false
|
|
507
507
|
end
|
|
508
508
|
|
|
509
509
|
it 'must return false for has_port_number?()' do
|
|
510
|
-
ImpURI.has_port_number?(@http_uri).must_equal false
|
|
511
|
-
ImpURI.has_port?(@http_uri).must_equal false
|
|
512
|
-
ImpURI.has_portnumber?(@http_uri).must_equal false
|
|
513
|
-
ImpURI.port_number?(@http_uri).must_equal false
|
|
514
|
-
ImpURI.port?(@http_uri).must_equal false
|
|
515
|
-
ImpURI.portnumber?(@http_uri).must_equal false
|
|
510
|
+
_(ImpURI.has_port_number?(@http_uri)).must_equal false
|
|
511
|
+
_(ImpURI.has_port?(@http_uri)).must_equal false
|
|
512
|
+
_(ImpURI.has_portnumber?(@http_uri)).must_equal false
|
|
513
|
+
_(ImpURI.port_number?(@http_uri)).must_equal false
|
|
514
|
+
_(ImpURI.port?(@http_uri)).must_equal false
|
|
515
|
+
_(ImpURI.portnumber?(@http_uri)).must_equal false
|
|
516
516
|
end
|
|
517
517
|
|
|
518
518
|
it 'must return false for is_ssh?()' do
|
|
519
|
-
ImpURI.is_ssh?(@http_uri).must_equal false
|
|
519
|
+
_(ImpURI.is_ssh?(@http_uri)).must_equal false
|
|
520
520
|
end
|
|
521
521
|
|
|
522
522
|
it 'must return the request URI' do
|
|
523
|
-
ImpURI.request_uri(@http_uri).must_equal '/?q=param1&r=param2'
|
|
523
|
+
_(ImpURI.request_uri(@http_uri)).must_equal '/?q=param1&r=param2'
|
|
524
524
|
end
|
|
525
525
|
end # describe 'an http URI with two GET query parameters'
|
|
526
526
|
|
|
@@ -530,65 +530,65 @@ describe ImpURI do
|
|
|
530
530
|
end
|
|
531
531
|
|
|
532
532
|
it 'must parse out the scheme' do
|
|
533
|
-
ImpURI.scheme(@http_uri).must_equal 'http'
|
|
534
|
-
ImpURI.protocol(@http_uri).must_equal 'http'
|
|
535
|
-
ImpURI.scheme_name(@http_uri).must_equal 'http'
|
|
533
|
+
_(ImpURI.scheme(@http_uri)).must_equal 'http'
|
|
534
|
+
_(ImpURI.protocol(@http_uri)).must_equal 'http'
|
|
535
|
+
_(ImpURI.scheme_name(@http_uri)).must_equal 'http'
|
|
536
536
|
end
|
|
537
537
|
|
|
538
538
|
it 'must parse out the domain name' do
|
|
539
|
-
ImpURI.hostname(@http_uri).must_equal 'example.com'
|
|
540
|
-
ImpURI.host(@http_uri).must_equal 'example.com'
|
|
539
|
+
_(ImpURI.hostname(@http_uri)).must_equal 'example.com'
|
|
540
|
+
_(ImpURI.host(@http_uri)).must_equal 'example.com'
|
|
541
541
|
end
|
|
542
542
|
|
|
543
543
|
it 'must parse out the paramter string' do
|
|
544
|
-
ImpURI.parameter_string(@http_uri).must_equal 'q=param1;r=param2'
|
|
544
|
+
_(ImpURI.parameter_string(@http_uri)).must_equal 'q=param1;r=param2'
|
|
545
545
|
end
|
|
546
546
|
|
|
547
547
|
it 'must parse out the parameter as a hash' do
|
|
548
|
-
ImpURI.parameters(@http_uri).must_equal({'q' => 'param1', 'r' => 'param2'})
|
|
548
|
+
_(ImpURI.parameters(@http_uri)).must_equal({'q' => 'param1', 'r' => 'param2'})
|
|
549
549
|
end
|
|
550
550
|
|
|
551
551
|
it 'must return false for has_userinfo?()' do
|
|
552
|
-
ImpURI.has_userinfo?(@http_uri).must_equal false
|
|
553
|
-
ImpURI.has_credentials?(@http_uri).must_equal false
|
|
554
|
-
ImpURI.has_username_and_password?(@http_uri).must_equal false
|
|
555
|
-
ImpURI.has_user_info?(@http_uri).must_equal false
|
|
556
|
-
ImpURI.userinfo?(@http_uri).must_equal false
|
|
557
|
-
ImpURI.credentials?(@http_uri).must_equal false
|
|
558
|
-
ImpURI.username_and_password?(@http_uri).must_equal false
|
|
559
|
-
ImpURI.user_info?(@http_uri).must_equal false
|
|
552
|
+
_(ImpURI.has_userinfo?(@http_uri)).must_equal false
|
|
553
|
+
_(ImpURI.has_credentials?(@http_uri)).must_equal false
|
|
554
|
+
_(ImpURI.has_username_and_password?(@http_uri)).must_equal false
|
|
555
|
+
_(ImpURI.has_user_info?(@http_uri)).must_equal false
|
|
556
|
+
_(ImpURI.userinfo?(@http_uri)).must_equal false
|
|
557
|
+
_(ImpURI.credentials?(@http_uri)).must_equal false
|
|
558
|
+
_(ImpURI.username_and_password?(@http_uri)).must_equal false
|
|
559
|
+
_(ImpURI.user_info?(@http_uri)).must_equal false
|
|
560
560
|
end
|
|
561
561
|
|
|
562
562
|
it 'must return true for has_scheme?()' do
|
|
563
|
-
ImpURI.has_scheme?(@http_uri).must_equal true
|
|
564
|
-
ImpURI.has_protocol?(@http_uri).must_equal true
|
|
565
|
-
ImpURI.has_scheme_name?(@http_uri).must_equal true
|
|
566
|
-
ImpURI.scheme?(@http_uri).must_equal true
|
|
567
|
-
ImpURI.protocol?(@http_uri).must_equal true
|
|
568
|
-
ImpURI.scheme_name?(@http_uri).must_equal true
|
|
563
|
+
_(ImpURI.has_scheme?(@http_uri)).must_equal true
|
|
564
|
+
_(ImpURI.has_protocol?(@http_uri)).must_equal true
|
|
565
|
+
_(ImpURI.has_scheme_name?(@http_uri)).must_equal true
|
|
566
|
+
_(ImpURI.scheme?(@http_uri)).must_equal true
|
|
567
|
+
_(ImpURI.protocol?(@http_uri)).must_equal true
|
|
568
|
+
_(ImpURI.scheme_name?(@http_uri)).must_equal true
|
|
569
569
|
end
|
|
570
570
|
|
|
571
571
|
it 'must return false for has_colon_path_separator?()' do
|
|
572
|
-
ImpURI.colon_path_separator?(@http_uri).must_equal false
|
|
573
|
-
ImpURI.has_colon_path_separator?(@http_uri).must_equal false
|
|
574
|
-
ImpURI.uses_colon_path_separator?(@http_uri).must_equal false
|
|
572
|
+
_(ImpURI.colon_path_separator?(@http_uri)).must_equal false
|
|
573
|
+
_(ImpURI.has_colon_path_separator?(@http_uri)).must_equal false
|
|
574
|
+
_(ImpURI.uses_colon_path_separator?(@http_uri)).must_equal false
|
|
575
575
|
end
|
|
576
576
|
|
|
577
577
|
it 'must return false for has_port_number?()' do
|
|
578
|
-
ImpURI.has_port_number?(@http_uri).must_equal false
|
|
579
|
-
ImpURI.has_port?(@http_uri).must_equal false
|
|
580
|
-
ImpURI.has_portnumber?(@http_uri).must_equal false
|
|
581
|
-
ImpURI.port_number?(@http_uri).must_equal false
|
|
582
|
-
ImpURI.port?(@http_uri).must_equal false
|
|
583
|
-
ImpURI.portnumber?(@http_uri).must_equal false
|
|
578
|
+
_(ImpURI.has_port_number?(@http_uri)).must_equal false
|
|
579
|
+
_(ImpURI.has_port?(@http_uri)).must_equal false
|
|
580
|
+
_(ImpURI.has_portnumber?(@http_uri)).must_equal false
|
|
581
|
+
_(ImpURI.port_number?(@http_uri)).must_equal false
|
|
582
|
+
_(ImpURI.port?(@http_uri)).must_equal false
|
|
583
|
+
_(ImpURI.portnumber?(@http_uri)).must_equal false
|
|
584
584
|
end
|
|
585
585
|
|
|
586
586
|
it 'must return false for is_ssh?()' do
|
|
587
|
-
ImpURI.is_ssh?(@http_uri).must_equal false
|
|
587
|
+
_(ImpURI.is_ssh?(@http_uri)).must_equal false
|
|
588
588
|
end
|
|
589
589
|
|
|
590
590
|
it 'must return the request URI' do
|
|
591
|
-
ImpURI.request_uri(@http_uri).must_equal '/?q=param1;r=param2'
|
|
591
|
+
_(ImpURI.request_uri(@http_uri)).must_equal '/?q=param1;r=param2'
|
|
592
592
|
end
|
|
593
593
|
end # describe 'an http URI with two GET query parameters separated by a semicolon'
|
|
594
594
|
|
|
@@ -598,93 +598,93 @@ describe ImpURI do
|
|
|
598
598
|
end
|
|
599
599
|
|
|
600
600
|
it 'must parse out the scheme' do
|
|
601
|
-
ImpURI.scheme(@http_uri).must_equal 'http'
|
|
602
|
-
ImpURI.protocol(@http_uri).must_equal 'http'
|
|
603
|
-
ImpURI.scheme_name(@http_uri).must_equal 'http'
|
|
601
|
+
_(ImpURI.scheme(@http_uri)).must_equal 'http'
|
|
602
|
+
_(ImpURI.protocol(@http_uri)).must_equal 'http'
|
|
603
|
+
_(ImpURI.scheme_name(@http_uri)).must_equal 'http'
|
|
604
604
|
end
|
|
605
605
|
|
|
606
606
|
it 'must parse out the domain name' do
|
|
607
|
-
ImpURI.hostname(@http_uri).must_equal 'example.com'
|
|
608
|
-
ImpURI.host(@http_uri).must_equal 'example.com'
|
|
607
|
+
_(ImpURI.hostname(@http_uri)).must_equal 'example.com'
|
|
608
|
+
_(ImpURI.host(@http_uri)).must_equal 'example.com'
|
|
609
609
|
end
|
|
610
610
|
|
|
611
611
|
it 'must parse out the path' do
|
|
612
|
-
ImpURI.path(@http_uri).must_equal '/path/to/resource'
|
|
612
|
+
_(ImpURI.path(@http_uri)).must_equal '/path/to/resource'
|
|
613
613
|
end
|
|
614
614
|
|
|
615
615
|
it 'must parse out the port number' do
|
|
616
|
-
ImpURI.port(@http_uri).must_equal '8080'
|
|
617
|
-
ImpURI.port_number(@http_uri).must_equal '8080'
|
|
618
|
-
ImpURI.port_number(@http_uri).must_equal '8080'
|
|
616
|
+
_(ImpURI.port(@http_uri)).must_equal '8080'
|
|
617
|
+
_(ImpURI.port_number(@http_uri)).must_equal '8080'
|
|
618
|
+
_(ImpURI.port_number(@http_uri)).must_equal '8080'
|
|
619
619
|
end
|
|
620
620
|
|
|
621
621
|
it 'must parse out the username' do
|
|
622
|
-
ImpURI.username(@http_uri).must_equal 'user'
|
|
623
|
-
ImpURI.user(@http_uri).must_equal 'user'
|
|
622
|
+
_(ImpURI.username(@http_uri)).must_equal 'user'
|
|
623
|
+
_(ImpURI.user(@http_uri)).must_equal 'user'
|
|
624
624
|
end
|
|
625
625
|
|
|
626
626
|
it 'must parse out the password' do
|
|
627
|
-
ImpURI.password(@http_uri).must_equal 'pass'
|
|
628
|
-
ImpURI.pass(@http_uri).must_equal 'pass'
|
|
629
|
-
ImpURI.passwd(@http_uri).must_equal 'pass'
|
|
627
|
+
_(ImpURI.password(@http_uri)).must_equal 'pass'
|
|
628
|
+
_(ImpURI.pass(@http_uri)).must_equal 'pass'
|
|
629
|
+
_(ImpURI.passwd(@http_uri)).must_equal 'pass'
|
|
630
630
|
end
|
|
631
631
|
|
|
632
632
|
it 'must return the userinfo string' do
|
|
633
|
-
ImpURI.userinfo(@http_uri).must_equal 'user:pass'
|
|
634
|
-
ImpURI.credentials(@http_uri).must_equal 'user:pass'
|
|
635
|
-
ImpURI.username_and_password(@http_uri).must_equal 'user:pass'
|
|
636
|
-
ImpURI.user_info(@http_uri).must_equal 'user:pass'
|
|
633
|
+
_(ImpURI.userinfo(@http_uri)).must_equal 'user:pass'
|
|
634
|
+
_(ImpURI.credentials(@http_uri)).must_equal 'user:pass'
|
|
635
|
+
_(ImpURI.username_and_password(@http_uri)).must_equal 'user:pass'
|
|
636
|
+
_(ImpURI.user_info(@http_uri)).must_equal 'user:pass'
|
|
637
637
|
end
|
|
638
638
|
|
|
639
639
|
it 'must parse out the paramter string' do
|
|
640
|
-
ImpURI.parameter_string(@http_uri).must_equal 'q=param1&r=param2'
|
|
640
|
+
_(ImpURI.parameter_string(@http_uri)).must_equal 'q=param1&r=param2'
|
|
641
641
|
end
|
|
642
642
|
|
|
643
643
|
it 'must parse out the parameter as a hash' do
|
|
644
|
-
ImpURI.parameters(@http_uri).must_equal({'q' => 'param1', 'r' => 'param2'})
|
|
644
|
+
_(ImpURI.parameters(@http_uri)).must_equal({'q' => 'param1', 'r' => 'param2'})
|
|
645
645
|
end
|
|
646
646
|
|
|
647
647
|
it 'must return true for has_userinfo?()' do
|
|
648
|
-
ImpURI.has_userinfo?(@http_uri).must_equal true
|
|
649
|
-
ImpURI.has_credentials?(@http_uri).must_equal true
|
|
650
|
-
ImpURI.has_username_and_password?(@http_uri).must_equal true
|
|
651
|
-
ImpURI.has_user_info?(@http_uri).must_equal true
|
|
652
|
-
ImpURI.userinfo?(@http_uri).must_equal true
|
|
653
|
-
ImpURI.credentials?(@http_uri).must_equal true
|
|
654
|
-
ImpURI.username_and_password?(@http_uri).must_equal true
|
|
655
|
-
ImpURI.user_info?(@http_uri).must_equal true
|
|
648
|
+
_(ImpURI.has_userinfo?(@http_uri)).must_equal true
|
|
649
|
+
_(ImpURI.has_credentials?(@http_uri)).must_equal true
|
|
650
|
+
_(ImpURI.has_username_and_password?(@http_uri)).must_equal true
|
|
651
|
+
_(ImpURI.has_user_info?(@http_uri)).must_equal true
|
|
652
|
+
_(ImpURI.userinfo?(@http_uri)).must_equal true
|
|
653
|
+
_(ImpURI.credentials?(@http_uri)).must_equal true
|
|
654
|
+
_(ImpURI.username_and_password?(@http_uri)).must_equal true
|
|
655
|
+
_(ImpURI.user_info?(@http_uri)).must_equal true
|
|
656
656
|
end
|
|
657
657
|
|
|
658
658
|
it 'must return true for has_scheme?()' do
|
|
659
|
-
ImpURI.has_scheme?(@http_uri).must_equal true
|
|
660
|
-
ImpURI.has_protocol?(@http_uri).must_equal true
|
|
661
|
-
ImpURI.has_scheme_name?(@http_uri).must_equal true
|
|
662
|
-
ImpURI.scheme?(@http_uri).must_equal true
|
|
663
|
-
ImpURI.protocol?(@http_uri).must_equal true
|
|
664
|
-
ImpURI.scheme_name?(@http_uri).must_equal true
|
|
659
|
+
_(ImpURI.has_scheme?(@http_uri)).must_equal true
|
|
660
|
+
_(ImpURI.has_protocol?(@http_uri)).must_equal true
|
|
661
|
+
_(ImpURI.has_scheme_name?(@http_uri)).must_equal true
|
|
662
|
+
_(ImpURI.scheme?(@http_uri)).must_equal true
|
|
663
|
+
_(ImpURI.protocol?(@http_uri)).must_equal true
|
|
664
|
+
_(ImpURI.scheme_name?(@http_uri)).must_equal true
|
|
665
665
|
end
|
|
666
666
|
|
|
667
667
|
it 'must return false for has_colon_path_separator?()' do
|
|
668
|
-
ImpURI.colon_path_separator?(@http_uri).must_equal false
|
|
669
|
-
ImpURI.has_colon_path_separator?(@http_uri).must_equal false
|
|
670
|
-
ImpURI.uses_colon_path_separator?(@http_uri).must_equal false
|
|
668
|
+
_(ImpURI.colon_path_separator?(@http_uri)).must_equal false
|
|
669
|
+
_(ImpURI.has_colon_path_separator?(@http_uri)).must_equal false
|
|
670
|
+
_(ImpURI.uses_colon_path_separator?(@http_uri)).must_equal false
|
|
671
671
|
end
|
|
672
672
|
|
|
673
673
|
it 'must return true for has_port_number?()' do
|
|
674
|
-
ImpURI.has_port_number?(@http_uri).must_equal true
|
|
675
|
-
ImpURI.has_port?(@http_uri).must_equal true
|
|
676
|
-
ImpURI.has_portnumber?(@http_uri).must_equal true
|
|
677
|
-
ImpURI.port_number?(@http_uri).must_equal true
|
|
678
|
-
ImpURI.port?(@http_uri).must_equal true
|
|
679
|
-
ImpURI.portnumber?(@http_uri).must_equal true
|
|
674
|
+
_(ImpURI.has_port_number?(@http_uri)).must_equal true
|
|
675
|
+
_(ImpURI.has_port?(@http_uri)).must_equal true
|
|
676
|
+
_(ImpURI.has_portnumber?(@http_uri)).must_equal true
|
|
677
|
+
_(ImpURI.port_number?(@http_uri)).must_equal true
|
|
678
|
+
_(ImpURI.port?(@http_uri)).must_equal true
|
|
679
|
+
_(ImpURI.portnumber?(@http_uri)).must_equal true
|
|
680
680
|
end
|
|
681
681
|
|
|
682
682
|
it 'must return false for is_ssh?()' do
|
|
683
|
-
ImpURI.is_ssh?(@http_uri).must_equal false
|
|
683
|
+
_(ImpURI.is_ssh?(@http_uri)).must_equal false
|
|
684
684
|
end
|
|
685
685
|
|
|
686
686
|
it 'must return the request URI' do
|
|
687
|
-
ImpURI.request_uri(@http_uri).must_equal '/path/to/resource?q=param1&r=param2'
|
|
687
|
+
_(ImpURI.request_uri(@http_uri)).must_equal '/path/to/resource?q=param1&r=param2'
|
|
688
688
|
end
|
|
689
689
|
end # describe 'an http URI with the lot'
|
|
690
690
|
|
|
@@ -694,93 +694,93 @@ describe ImpURI do
|
|
|
694
694
|
end
|
|
695
695
|
|
|
696
696
|
it 'must parse out the scheme' do
|
|
697
|
-
ImpURI.scheme(@http_uri).must_equal 'http'
|
|
698
|
-
ImpURI.protocol(@http_uri).must_equal 'http'
|
|
699
|
-
ImpURI.scheme_name(@http_uri).must_equal 'http'
|
|
697
|
+
_(ImpURI.scheme(@http_uri)).must_equal 'http'
|
|
698
|
+
_(ImpURI.protocol(@http_uri)).must_equal 'http'
|
|
699
|
+
_(ImpURI.scheme_name(@http_uri)).must_equal 'http'
|
|
700
700
|
end
|
|
701
701
|
|
|
702
702
|
it 'must parse out the domain name' do
|
|
703
|
-
ImpURI.hostname(@http_uri).must_equal 'example.com'
|
|
704
|
-
ImpURI.host(@http_uri).must_equal 'example.com'
|
|
703
|
+
_(ImpURI.hostname(@http_uri)).must_equal 'example.com'
|
|
704
|
+
_(ImpURI.host(@http_uri)).must_equal 'example.com'
|
|
705
705
|
end
|
|
706
706
|
|
|
707
707
|
it 'must parse out the path' do
|
|
708
|
-
ImpURI.path(@http_uri).must_equal '/path/to/resource'
|
|
708
|
+
_(ImpURI.path(@http_uri)).must_equal '/path/to/resource'
|
|
709
709
|
end
|
|
710
710
|
|
|
711
711
|
it 'must parse out the port number' do
|
|
712
|
-
ImpURI.port(@http_uri).must_equal '8080'
|
|
713
|
-
ImpURI.port_number(@http_uri).must_equal '8080'
|
|
714
|
-
ImpURI.port_number(@http_uri).must_equal '8080'
|
|
712
|
+
_(ImpURI.port(@http_uri)).must_equal '8080'
|
|
713
|
+
_(ImpURI.port_number(@http_uri)).must_equal '8080'
|
|
714
|
+
_(ImpURI.port_number(@http_uri)).must_equal '8080'
|
|
715
715
|
end
|
|
716
716
|
|
|
717
717
|
it 'must parse out the username' do
|
|
718
|
-
ImpURI.username(@http_uri).must_equal 'user'
|
|
719
|
-
ImpURI.user(@http_uri).must_equal 'user'
|
|
718
|
+
_(ImpURI.username(@http_uri)).must_equal 'user'
|
|
719
|
+
_(ImpURI.user(@http_uri)).must_equal 'user'
|
|
720
720
|
end
|
|
721
721
|
|
|
722
722
|
it 'must parse out the password' do
|
|
723
|
-
ImpURI.password(@http_uri).must_equal 'pass'
|
|
724
|
-
ImpURI.pass(@http_uri).must_equal 'pass'
|
|
725
|
-
ImpURI.passwd(@http_uri).must_equal 'pass'
|
|
723
|
+
_(ImpURI.password(@http_uri)).must_equal 'pass'
|
|
724
|
+
_(ImpURI.pass(@http_uri)).must_equal 'pass'
|
|
725
|
+
_(ImpURI.passwd(@http_uri)).must_equal 'pass'
|
|
726
726
|
end
|
|
727
727
|
|
|
728
728
|
it 'must return the userinfo string' do
|
|
729
|
-
ImpURI.userinfo(@http_uri).must_equal 'user:pass'
|
|
730
|
-
ImpURI.credentials(@http_uri).must_equal 'user:pass'
|
|
731
|
-
ImpURI.username_and_password(@http_uri).must_equal 'user:pass'
|
|
732
|
-
ImpURI.user_info(@http_uri).must_equal 'user:pass'
|
|
729
|
+
_(ImpURI.userinfo(@http_uri)).must_equal 'user:pass'
|
|
730
|
+
_(ImpURI.credentials(@http_uri)).must_equal 'user:pass'
|
|
731
|
+
_(ImpURI.username_and_password(@http_uri)).must_equal 'user:pass'
|
|
732
|
+
_(ImpURI.user_info(@http_uri)).must_equal 'user:pass'
|
|
733
733
|
end
|
|
734
734
|
|
|
735
735
|
it 'must parse out the paramter string' do
|
|
736
|
-
ImpURI.parameter_string(@http_uri).must_equal 'q=param1;r=param2'
|
|
736
|
+
_(ImpURI.parameter_string(@http_uri)).must_equal 'q=param1;r=param2'
|
|
737
737
|
end
|
|
738
738
|
|
|
739
739
|
it 'must parse out the parameter as a hash' do
|
|
740
|
-
ImpURI.parameters(@http_uri).must_equal({'q' => 'param1', 'r' => 'param2'})
|
|
740
|
+
_(ImpURI.parameters(@http_uri)).must_equal({'q' => 'param1', 'r' => 'param2'})
|
|
741
741
|
end
|
|
742
742
|
|
|
743
743
|
it 'must return true for has_userinfo?()' do
|
|
744
|
-
ImpURI.has_userinfo?(@http_uri).must_equal true
|
|
745
|
-
ImpURI.has_credentials?(@http_uri).must_equal true
|
|
746
|
-
ImpURI.has_username_and_password?(@http_uri).must_equal true
|
|
747
|
-
ImpURI.has_user_info?(@http_uri).must_equal true
|
|
748
|
-
ImpURI.userinfo?(@http_uri).must_equal true
|
|
749
|
-
ImpURI.credentials?(@http_uri).must_equal true
|
|
750
|
-
ImpURI.username_and_password?(@http_uri).must_equal true
|
|
751
|
-
ImpURI.user_info?(@http_uri).must_equal true
|
|
744
|
+
_(ImpURI.has_userinfo?(@http_uri)).must_equal true
|
|
745
|
+
_(ImpURI.has_credentials?(@http_uri)).must_equal true
|
|
746
|
+
_(ImpURI.has_username_and_password?(@http_uri)).must_equal true
|
|
747
|
+
_(ImpURI.has_user_info?(@http_uri)).must_equal true
|
|
748
|
+
_(ImpURI.userinfo?(@http_uri)).must_equal true
|
|
749
|
+
_(ImpURI.credentials?(@http_uri)).must_equal true
|
|
750
|
+
_(ImpURI.username_and_password?(@http_uri)).must_equal true
|
|
751
|
+
_(ImpURI.user_info?(@http_uri)).must_equal true
|
|
752
752
|
end
|
|
753
753
|
|
|
754
754
|
it 'must return true for has_scheme?()' do
|
|
755
|
-
ImpURI.has_scheme?(@http_uri).must_equal true
|
|
756
|
-
ImpURI.has_protocol?(@http_uri).must_equal true
|
|
757
|
-
ImpURI.has_scheme_name?(@http_uri).must_equal true
|
|
758
|
-
ImpURI.scheme?(@http_uri).must_equal true
|
|
759
|
-
ImpURI.protocol?(@http_uri).must_equal true
|
|
760
|
-
ImpURI.scheme_name?(@http_uri).must_equal true
|
|
755
|
+
_(ImpURI.has_scheme?(@http_uri)).must_equal true
|
|
756
|
+
_(ImpURI.has_protocol?(@http_uri)).must_equal true
|
|
757
|
+
_(ImpURI.has_scheme_name?(@http_uri)).must_equal true
|
|
758
|
+
_(ImpURI.scheme?(@http_uri)).must_equal true
|
|
759
|
+
_(ImpURI.protocol?(@http_uri)).must_equal true
|
|
760
|
+
_(ImpURI.scheme_name?(@http_uri)).must_equal true
|
|
761
761
|
end
|
|
762
762
|
|
|
763
763
|
it 'must return false for has_colon_path_separator?()' do
|
|
764
|
-
ImpURI.colon_path_separator?(@http_uri).must_equal false
|
|
765
|
-
ImpURI.has_colon_path_separator?(@http_uri).must_equal false
|
|
766
|
-
ImpURI.uses_colon_path_separator?(@http_uri).must_equal false
|
|
764
|
+
_(ImpURI.colon_path_separator?(@http_uri)).must_equal false
|
|
765
|
+
_(ImpURI.has_colon_path_separator?(@http_uri)).must_equal false
|
|
766
|
+
_(ImpURI.uses_colon_path_separator?(@http_uri)).must_equal false
|
|
767
767
|
end
|
|
768
768
|
|
|
769
769
|
it 'must return true for has_port_number?()' do
|
|
770
|
-
ImpURI.has_port_number?(@http_uri).must_equal true
|
|
771
|
-
ImpURI.has_port?(@http_uri).must_equal true
|
|
772
|
-
ImpURI.has_portnumber?(@http_uri).must_equal true
|
|
773
|
-
ImpURI.port_number?(@http_uri).must_equal true
|
|
774
|
-
ImpURI.port?(@http_uri).must_equal true
|
|
775
|
-
ImpURI.portnumber?(@http_uri).must_equal true
|
|
770
|
+
_(ImpURI.has_port_number?(@http_uri)).must_equal true
|
|
771
|
+
_(ImpURI.has_port?(@http_uri)).must_equal true
|
|
772
|
+
_(ImpURI.has_portnumber?(@http_uri)).must_equal true
|
|
773
|
+
_(ImpURI.port_number?(@http_uri)).must_equal true
|
|
774
|
+
_(ImpURI.port?(@http_uri)).must_equal true
|
|
775
|
+
_(ImpURI.portnumber?(@http_uri)).must_equal true
|
|
776
776
|
end
|
|
777
777
|
|
|
778
778
|
it 'must return false for is_ssh?()' do
|
|
779
|
-
ImpURI.is_ssh?(@http_uri).must_equal false
|
|
779
|
+
_(ImpURI.is_ssh?(@http_uri)).must_equal false
|
|
780
780
|
end
|
|
781
781
|
|
|
782
782
|
it 'must return the request URI' do
|
|
783
|
-
ImpURI.request_uri(@http_uri).must_equal '/path/to/resource?q=param1;r=param2'
|
|
783
|
+
_(ImpURI.request_uri(@http_uri)).must_equal '/path/to/resource?q=param1;r=param2'
|
|
784
784
|
end
|
|
785
785
|
end # describe 'an http URI with the lot and a semicolon path separator'
|
|
786
786
|
|
|
@@ -790,62 +790,62 @@ describe ImpURI do
|
|
|
790
790
|
end
|
|
791
791
|
|
|
792
792
|
it 'must return a username' do
|
|
793
|
-
ImpURI.username(@ssh_identifier).must_equal 'username'
|
|
793
|
+
_(ImpURI.username(@ssh_identifier)).must_equal 'username'
|
|
794
794
|
end
|
|
795
795
|
|
|
796
796
|
it 'must correctly determine if it has user info' do
|
|
797
|
-
ImpURI.credentials?(@ssh_identifier).must_equal false
|
|
798
|
-
ImpURI.username_and_password?(@ssh_identifier).must_equal false
|
|
799
|
-
ImpURI.user_info?(@ssh_identifier).must_equal false
|
|
800
|
-
ImpURI.userinfo?(@ssh_identifier).must_equal false
|
|
801
|
-
ImpURI.has_credentials?(@ssh_identifier).must_equal false
|
|
802
|
-
ImpURI.has_username_and_password?(@ssh_identifier).must_equal false
|
|
803
|
-
ImpURI.has_user_info?(@ssh_identifier).must_equal false
|
|
804
|
-
ImpURI.has_userinfo?(@ssh_identifier).must_equal false
|
|
797
|
+
_(ImpURI.credentials?(@ssh_identifier)).must_equal false
|
|
798
|
+
_(ImpURI.username_and_password?(@ssh_identifier)).must_equal false
|
|
799
|
+
_(ImpURI.user_info?(@ssh_identifier)).must_equal false
|
|
800
|
+
_(ImpURI.userinfo?(@ssh_identifier)).must_equal false
|
|
801
|
+
_(ImpURI.has_credentials?(@ssh_identifier)).must_equal false
|
|
802
|
+
_(ImpURI.has_username_and_password?(@ssh_identifier)).must_equal false
|
|
803
|
+
_(ImpURI.has_user_info?(@ssh_identifier)).must_equal false
|
|
804
|
+
_(ImpURI.has_userinfo?(@ssh_identifier)).must_equal false
|
|
805
805
|
end
|
|
806
806
|
|
|
807
807
|
it 'must correctly determine if it has a scheme' do
|
|
808
|
-
ImpURI.has_scheme?(@ssh_identifier).must_equal false
|
|
809
|
-
ImpURI.has_protocol?(@ssh_identifier).must_equal false
|
|
810
|
-
ImpURI.has_scheme_name?(@ssh_identifier).must_equal false
|
|
811
|
-
ImpURI.scheme?(@ssh_identifier).must_equal false
|
|
812
|
-
ImpURI.protocol?(@ssh_identifier).must_equal false
|
|
813
|
-
ImpURI.scheme_name?(@ssh_identifier).must_equal false
|
|
808
|
+
_(ImpURI.has_scheme?(@ssh_identifier)).must_equal false
|
|
809
|
+
_(ImpURI.has_protocol?(@ssh_identifier)).must_equal false
|
|
810
|
+
_(ImpURI.has_scheme_name?(@ssh_identifier)).must_equal false
|
|
811
|
+
_(ImpURI.scheme?(@ssh_identifier)).must_equal false
|
|
812
|
+
_(ImpURI.protocol?(@ssh_identifier)).must_equal false
|
|
813
|
+
_(ImpURI.scheme_name?(@ssh_identifier)).must_equal false
|
|
814
814
|
end
|
|
815
815
|
|
|
816
816
|
it 'must correctly determine if it has a colon path separator' do
|
|
817
|
-
ImpURI.colon_path_separator?(@ssh_identifier).must_equal true
|
|
818
|
-
ImpURI.has_colon_path_separator?(@ssh_identifier).must_equal true
|
|
819
|
-
ImpURI.uses_colon_path_separator?(@ssh_identifier).must_equal true
|
|
817
|
+
_(ImpURI.colon_path_separator?(@ssh_identifier)).must_equal true
|
|
818
|
+
_(ImpURI.has_colon_path_separator?(@ssh_identifier)).must_equal true
|
|
819
|
+
_(ImpURI.uses_colon_path_separator?(@ssh_identifier)).must_equal true
|
|
820
820
|
end
|
|
821
821
|
|
|
822
822
|
it 'must correctly determine if it has a port number' do
|
|
823
|
-
ImpURI.has_port_number?(@ssh_identifier).must_equal false
|
|
824
|
-
ImpURI.has_port?(@ssh_identifier).must_equal false
|
|
825
|
-
ImpURI.has_portnumber?(@ssh_identifier).must_equal false
|
|
826
|
-
ImpURI.port_number?(@ssh_identifier).must_equal false
|
|
827
|
-
ImpURI.port?(@ssh_identifier).must_equal false
|
|
828
|
-
ImpURI.portnumber?(@ssh_identifier).must_equal false
|
|
823
|
+
_(ImpURI.has_port_number?(@ssh_identifier)).must_equal false
|
|
824
|
+
_(ImpURI.has_port?(@ssh_identifier)).must_equal false
|
|
825
|
+
_(ImpURI.has_portnumber?(@ssh_identifier)).must_equal false
|
|
826
|
+
_(ImpURI.port_number?(@ssh_identifier)).must_equal false
|
|
827
|
+
_(ImpURI.port?(@ssh_identifier)).must_equal false
|
|
828
|
+
_(ImpURI.portnumber?(@ssh_identifier)).must_equal false
|
|
829
829
|
end
|
|
830
830
|
|
|
831
831
|
it 'must return true for is_ssh?()' do
|
|
832
|
-
ImpURI.is_ssh?(@ssh_identifier).must_equal true
|
|
832
|
+
_(ImpURI.is_ssh?(@ssh_identifier)).must_equal true
|
|
833
833
|
end
|
|
834
834
|
|
|
835
835
|
it 'must return hostname_and_path when requested' do
|
|
836
|
-
ImpURI.hostname_and_path(@ssh_identifier).must_equal 'example.com:~account'
|
|
836
|
+
_(ImpURI.hostname_and_path(@ssh_identifier)).must_equal 'example.com:~account'
|
|
837
837
|
end
|
|
838
838
|
|
|
839
839
|
it 'must return hostname_and_port_number when requested' do
|
|
840
|
-
ImpURI.hostname_and_port_number(@ssh_identifier).must_equal 'example.com'
|
|
840
|
+
_(ImpURI.hostname_and_port_number(@ssh_identifier)).must_equal 'example.com'
|
|
841
841
|
end
|
|
842
842
|
|
|
843
843
|
it 'must return a hostname' do
|
|
844
|
-
ImpURI.hostname(@ssh_identifier).must_equal 'example.com'
|
|
844
|
+
_(ImpURI.hostname(@ssh_identifier)).must_equal 'example.com'
|
|
845
845
|
end
|
|
846
846
|
|
|
847
847
|
it 'must return a path' do
|
|
848
|
-
ImpURI.path(@ssh_identifier).must_equal '~account'
|
|
848
|
+
_(ImpURI.path(@ssh_identifier)).must_equal '~account'
|
|
849
849
|
end
|
|
850
850
|
end # describe 'an ssh identifier'
|
|
851
851
|
|
|
@@ -855,62 +855,62 @@ describe ImpURI do
|
|
|
855
855
|
end
|
|
856
856
|
|
|
857
857
|
it 'must return a username' do
|
|
858
|
-
ImpURI.username(@ssh_identifier).must_equal 'git'
|
|
858
|
+
_(ImpURI.username(@ssh_identifier)).must_equal 'git'
|
|
859
859
|
end
|
|
860
860
|
|
|
861
861
|
it 'must correctly determine if it has user info' do
|
|
862
|
-
ImpURI.credentials?(@ssh_identifier).must_equal false
|
|
863
|
-
ImpURI.username_and_password?(@ssh_identifier).must_equal false
|
|
864
|
-
ImpURI.user_info?(@ssh_identifier).must_equal false
|
|
865
|
-
ImpURI.userinfo?(@ssh_identifier).must_equal false
|
|
866
|
-
ImpURI.has_credentials?(@ssh_identifier).must_equal false
|
|
867
|
-
ImpURI.has_username_and_password?(@ssh_identifier).must_equal false
|
|
868
|
-
ImpURI.has_user_info?(@ssh_identifier).must_equal false
|
|
869
|
-
ImpURI.has_userinfo?(@ssh_identifier).must_equal false
|
|
862
|
+
_(ImpURI.credentials?(@ssh_identifier)).must_equal false
|
|
863
|
+
_(ImpURI.username_and_password?(@ssh_identifier)).must_equal false
|
|
864
|
+
_(ImpURI.user_info?(@ssh_identifier)).must_equal false
|
|
865
|
+
_(ImpURI.userinfo?(@ssh_identifier)).must_equal false
|
|
866
|
+
_(ImpURI.has_credentials?(@ssh_identifier)).must_equal false
|
|
867
|
+
_(ImpURI.has_username_and_password?(@ssh_identifier)).must_equal false
|
|
868
|
+
_(ImpURI.has_user_info?(@ssh_identifier)).must_equal false
|
|
869
|
+
_(ImpURI.has_userinfo?(@ssh_identifier)).must_equal false
|
|
870
870
|
end
|
|
871
871
|
|
|
872
872
|
it 'must correctly determine if it has a scheme' do
|
|
873
|
-
ImpURI.has_scheme?(@ssh_identifier).must_equal false
|
|
874
|
-
ImpURI.has_protocol?(@ssh_identifier).must_equal false
|
|
875
|
-
ImpURI.has_scheme_name?(@ssh_identifier).must_equal false
|
|
876
|
-
ImpURI.scheme?(@ssh_identifier).must_equal false
|
|
877
|
-
ImpURI.protocol?(@ssh_identifier).must_equal false
|
|
878
|
-
ImpURI.scheme_name?(@ssh_identifier).must_equal false
|
|
873
|
+
_(ImpURI.has_scheme?(@ssh_identifier)).must_equal false
|
|
874
|
+
_(ImpURI.has_protocol?(@ssh_identifier)).must_equal false
|
|
875
|
+
_(ImpURI.has_scheme_name?(@ssh_identifier)).must_equal false
|
|
876
|
+
_(ImpURI.scheme?(@ssh_identifier)).must_equal false
|
|
877
|
+
_(ImpURI.protocol?(@ssh_identifier)).must_equal false
|
|
878
|
+
_(ImpURI.scheme_name?(@ssh_identifier)).must_equal false
|
|
879
879
|
end
|
|
880
880
|
|
|
881
881
|
it 'must correctly determine if it has a colon path separator' do
|
|
882
|
-
ImpURI.colon_path_separator?(@ssh_identifier).must_equal true
|
|
883
|
-
ImpURI.has_colon_path_separator?(@ssh_identifier).must_equal true
|
|
884
|
-
ImpURI.uses_colon_path_separator?(@ssh_identifier).must_equal true
|
|
882
|
+
_(ImpURI.colon_path_separator?(@ssh_identifier)).must_equal true
|
|
883
|
+
_(ImpURI.has_colon_path_separator?(@ssh_identifier)).must_equal true
|
|
884
|
+
_(ImpURI.uses_colon_path_separator?(@ssh_identifier)).must_equal true
|
|
885
885
|
end
|
|
886
886
|
|
|
887
887
|
it 'must correctly determine if it has a port number' do
|
|
888
|
-
ImpURI.has_port_number?(@ssh_identifier).must_equal false
|
|
889
|
-
ImpURI.has_port?(@ssh_identifier).must_equal false
|
|
890
|
-
ImpURI.has_portnumber?(@ssh_identifier).must_equal false
|
|
891
|
-
ImpURI.port_number?(@ssh_identifier).must_equal false
|
|
892
|
-
ImpURI.port?(@ssh_identifier).must_equal false
|
|
893
|
-
ImpURI.portnumber?(@ssh_identifier).must_equal false
|
|
888
|
+
_(ImpURI.has_port_number?(@ssh_identifier)).must_equal false
|
|
889
|
+
_(ImpURI.has_port?(@ssh_identifier)).must_equal false
|
|
890
|
+
_(ImpURI.has_portnumber?(@ssh_identifier)).must_equal false
|
|
891
|
+
_(ImpURI.port_number?(@ssh_identifier)).must_equal false
|
|
892
|
+
_(ImpURI.port?(@ssh_identifier)).must_equal false
|
|
893
|
+
_(ImpURI.portnumber?(@ssh_identifier)).must_equal false
|
|
894
894
|
end
|
|
895
895
|
|
|
896
896
|
it 'must return true for is_ssh?()' do
|
|
897
|
-
ImpURI.is_ssh?(@ssh_identifier).must_equal true
|
|
897
|
+
_(ImpURI.is_ssh?(@ssh_identifier)).must_equal true
|
|
898
898
|
end
|
|
899
899
|
|
|
900
900
|
it 'must return hostname_and_path when requested' do
|
|
901
|
-
ImpURI.hostname_and_path(@ssh_identifier).must_equal 'github.com:thoran/ImpURI.git'
|
|
901
|
+
_(ImpURI.hostname_and_path(@ssh_identifier)).must_equal 'github.com:thoran/ImpURI.git'
|
|
902
902
|
end
|
|
903
903
|
|
|
904
904
|
it 'must return hostname_and_port_number when requested' do
|
|
905
|
-
ImpURI.hostname_and_port_number(@ssh_identifier).must_equal 'github.com'
|
|
905
|
+
_(ImpURI.hostname_and_port_number(@ssh_identifier)).must_equal 'github.com'
|
|
906
906
|
end
|
|
907
907
|
|
|
908
908
|
it 'must return a hostname' do
|
|
909
|
-
ImpURI.hostname(@ssh_identifier).must_equal 'github.com'
|
|
909
|
+
_(ImpURI.hostname(@ssh_identifier)).must_equal 'github.com'
|
|
910
910
|
end
|
|
911
911
|
|
|
912
912
|
it 'must return a path' do
|
|
913
|
-
ImpURI.path(@ssh_identifier).must_equal 'thoran/ImpURI.git'
|
|
913
|
+
_(ImpURI.path(@ssh_identifier)).must_equal 'thoran/ImpURI.git'
|
|
914
914
|
end
|
|
915
915
|
end # describe 'an ssh identifier as per Github'
|
|
916
916
|
|