glebtv-httpclient 3.2.7 → 3.2.8

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.
data/spec/cookie_spec.rb CHANGED
@@ -9,111 +9,111 @@ describe 'Cookies' do
9
9
  @c = WebAgent::Cookie.new()
10
10
  end
11
11
 
12
- it { @c.should be_an_instance_of WebAgent::Cookie }
12
+ it { expect(@c).to be_an_instance_of WebAgent::Cookie }
13
13
 
14
14
  it '#discard' do
15
- (!!@c.discard?).should be_false
15
+ expect(!!@c.discard?).to be_falsey
16
16
  @c.discard = true
17
- (!!@c.discard?).should be_true
17
+ expect(!!@c.discard?).to be_truthy
18
18
  end
19
19
 
20
20
  it '#match?' do
21
21
  url = urify('http://www.rubycolor.org/hoge/funi/#919191')
22
22
 
23
23
  @c.domain = 'www.rubycolor.org'
24
- @c.match?(url).should be_true
24
+ expect(@c.match?(url)).to be_truthy
25
25
 
26
26
  @c.domain = '.rubycolor.org'
27
- @c.match?(url).should be_true
27
+ expect(@c.match?(url)).to be_truthy
28
28
 
29
29
  @c.domain = 'aaa.www.rubycolor.org'
30
- @c.match?(url).should be_false
30
+ expect(@c.match?(url)).to be_falsey
31
31
 
32
32
  @c.domain = 'aaa.www.rubycolor.org'
33
- @c.match?(url).should be_false
33
+ expect(@c.match?(url)).to be_falsey
34
34
 
35
35
  @c.domain = 'www.rubycolor.org'
36
36
  @c.path = '/'
37
- @c.match?(url).should be_true
37
+ expect(@c.match?(url)).to be_truthy
38
38
 
39
39
  @c.domain = 'www.rubycolor.org'
40
40
  @c.path = '/hoge'
41
- @c.match?(url).should be_true
41
+ expect(@c.match?(url)).to be_truthy
42
42
 
43
43
  @c.domain = 'www.rubycolor.org'
44
44
  @c.path = '/hoge/hoge'
45
- @c.match?(url).should be_false
45
+ expect(@c.match?(url)).to be_falsey
46
46
 
47
47
  @c.domain = 'www.rubycolor.org'
48
48
  @c.path = '/hoge'
49
49
  @c.secure = true
50
- @c.match?(url).should be_false
50
+ expect(@c.match?(url)).to be_falsey
51
51
 
52
52
  url2 = urify('https://www.rubycolor.org/hoge/funi/#919191')
53
53
  @c.domain = 'www.rubycolor.org'
54
54
  @c.path = '/hoge'
55
55
  @c.secure = true
56
- @c.match?(url2).should be_true
56
+ expect(@c.match?(url2)).to be_truthy
57
57
 
58
58
  @c.domain = 'www.rubycolor.org'
59
59
  @c.path = '/hoge'
60
60
  @c.secure = nil
61
- @c.match?(url2).should be_true
61
+ expect(@c.match?(url2)).to be_truthy
62
62
 
63
63
  url.port = 80
64
64
  @c.domain = 'www.rubycolor.org'
65
65
  @c.path = '/hoge'
66
- @c.match?(url).should be_true
66
+ expect(@c.match?(url)).to be_truthy
67
67
 
68
68
  url_nopath = URI.parse('http://www.rubycolor.org')
69
69
  @c.domain = 'www.rubycolor.org'
70
70
  @c.path = '/'
71
- @c.match?(url_nopath).should be_true
71
+ expect(@c.match?(url_nopath)).to be_truthy
72
72
  end
73
73
 
74
74
  it '#head_match?' do
75
- @c.head_match?("","").should be_true
76
- @c.head_match?("a","").should be_false
77
- @c.head_match?("","a").should be_true
78
- @c.head_match?("abcde","abcde").should be_true
79
- @c.head_match?("abcde","abcdef").should be_true
80
- @c.head_match?("abcdef","abcde").should be_false
81
- @c.head_match?("abcde","bcde").should be_false
82
- @c.head_match?("bcde","abcde").should be_false
75
+ expect(@c.head_match?("","")).to be_truthy
76
+ expect(@c.head_match?("a","")).to be_falsey
77
+ expect(@c.head_match?("","a")).to be_truthy
78
+ expect(@c.head_match?("abcde","abcde")).to be_truthy
79
+ expect(@c.head_match?("abcde","abcdef")).to be_truthy
80
+ expect(@c.head_match?("abcdef","abcde")).to be_falsey
81
+ expect(@c.head_match?("abcde","bcde")).to be_falsey
82
+ expect(@c.head_match?("bcde","abcde")).to be_falsey
83
83
  end
84
84
 
85
85
  it 'tail_match?' do
86
- @c.tail_match?("","").should be_true
87
- @c.tail_match?("a","").should be_false
88
- @c.tail_match?("","a").should be_true
89
- @c.tail_match?("abcde","abcde").should be_true
90
- @c.tail_match?("abcde","abcdef").should be_false
91
- @c.tail_match?("abcdef","abcde").should be_false
92
- @c.tail_match?("abcde","bcde").should be_false
93
- @c.tail_match?("bcde","abcde").should be_true
86
+ expect(@c.tail_match?("","")).to be_truthy
87
+ expect(@c.tail_match?("a","")).to be_falsey
88
+ expect(@c.tail_match?("","a")).to be_truthy
89
+ expect(@c.tail_match?("abcde","abcde")).to be_truthy
90
+ expect(@c.tail_match?("abcde","abcdef")).to be_falsey
91
+ expect(@c.tail_match?("abcdef","abcde")).to be_falsey
92
+ expect(@c.tail_match?("abcde","bcde")).to be_falsey
93
+ expect(@c.tail_match?("bcde","abcde")).to be_truthy
94
94
  end
95
95
 
96
96
 
97
97
  it 'domain_match' do
98
98
  extend WebAgent::CookieUtils
99
- (!!domain_match("hoge.co.jp",".")).should be_true
100
- (!!domain_match("192.168.10.1","192.168.10.1")).should be_true
101
- (!!domain_match("192.168.10.1","192.168.10.2")).should be_false
102
- (!!domain_match("hoge.co.jp",".hoge.co.jp")).should be_true
103
- (!!domain_match("www.hoge.co.jp", "www.hoge.co.jp")).should be_true
104
- (!!domain_match("www.hoge.co.jp", "www2.hoge.co.jp")).should be_false
105
- (!!domain_match("www.hoge.co.jp", ".hoge.co.jp")).should be_true
106
- (!!domain_match("www.aa.hoge.co.jp", ".hoge.co.jp")).should be_true
107
- (!!domain_match("www.hoge.co.jp", "hoge.co.jp")).should be_false
99
+ expect(!!domain_match("hoge.co.jp",".")).to be_truthy
100
+ expect(!!domain_match("192.168.10.1","192.168.10.1")).to be_truthy
101
+ expect(!!domain_match("192.168.10.1","192.168.10.2")).to be_falsey
102
+ expect(!!domain_match("hoge.co.jp",".hoge.co.jp")).to be_truthy
103
+ expect(!!domain_match("www.hoge.co.jp", "www.hoge.co.jp")).to be_truthy
104
+ expect(!!domain_match("www.hoge.co.jp", "www2.hoge.co.jp")).to be_falsey
105
+ expect(!!domain_match("www.hoge.co.jp", ".hoge.co.jp")).to be_truthy
106
+ expect(!!domain_match("www.aa.hoge.co.jp", ".hoge.co.jp")).to be_truthy
107
+ expect(!!domain_match("www.hoge.co.jp", "hoge.co.jp")).to be_falsey
108
108
  end
109
109
 
110
110
  it 'join_quotedstr' do
111
111
  arr1 = ['hoge=funi', 'hoge2=funi2']
112
- arr1.should eq @c.instance_eval{join_quotedstr(arr1,';')}
112
+ expect(arr1).to eq @c.instance_eval{join_quotedstr(arr1,';')}
113
113
  arr2 = ['hoge="fu', 'ni"', 'funi=funi']
114
- ['hoge="fu;ni"','funi=funi'].should eq @c.instance_eval{join_quotedstr(arr2,';')}
114
+ expect(['hoge="fu;ni"','funi=funi']).to eq @c.instance_eval{join_quotedstr(arr2,';')}
115
115
  arr3 = ['hoge="funi";hoge2="fu','ni2";hoge3="hoge"', 'funi="funi"']
116
- ['hoge="funi";hoge2="fu,ni2";hoge3="hoge"', 'funi="funi"'].should eq @c.instance_eval{join_quotedstr(arr3,',')}
116
+ expect(['hoge="funi";hoge2="fu,ni2";hoge3="hoge"', 'funi="funi"']).to eq @c.instance_eval{join_quotedstr(arr3,',')}
117
117
  end
118
118
  end
119
119
 
@@ -127,52 +127,52 @@ describe 'CookieManager' do
127
127
  str = "inkid=n92b0ADOgACIgUb9lsjHqAAAHu2a; expires=Wed, 01-Dec-2010 00:00:00 GMT; path=/"
128
128
  @cm.parse(str, urify('http://www.test.jp'))
129
129
  cookie = @cm.cookies[0]
130
- cookie.should be_an_instance_of WebAgent::Cookie
131
- cookie.name.should eq "inkid"
132
- cookie.value.should eq "n92b0ADOgACIgUb9lsjHqAAAHu2a"
133
- cookie.expires.should eq Time.gm(2010, 12, 1, 0,0,0)
134
- cookie.path.should eq "/"
130
+ expect(cookie).to be_an_instance_of WebAgent::Cookie
131
+ expect(cookie.name).to eq "inkid"
132
+ expect(cookie.value).to eq "n92b0ADOgACIgUb9lsjHqAAAHu2a"
133
+ expect(cookie.expires).to eq Time.gm(2010, 12, 1, 0,0,0)
134
+ expect(cookie.path).to eq "/"
135
135
  end
136
136
 
137
137
  it 'parse2' do
138
138
  str = "xmen=off,0,0,1; path=/; domain=.excite.co.jp; expires=Wednesday, 31-Dec-2037 12:00:00 GMT"
139
139
  @cm.parse(str, urify('http://www.excite.co.jp'))
140
140
  cookie = @cm.cookies[0]
141
- cookie.should be_an_instance_of WebAgent::Cookie
142
- cookie.name.should eq "xmen"
143
- cookie.value.should eq "off,0,0,1"
144
- cookie.domain.should eq ".excite.co.jp"
145
- cookie.expires.should eq Time.gm(2037,12,31,12,0,0)
146
- cookie.path.should eq "/"
147
-
148
- cookie.secure?.should be_false
149
- cookie.http_only?.should be_false
141
+ expect(cookie).to be_an_instance_of WebAgent::Cookie
142
+ expect(cookie.name).to eq "xmen"
143
+ expect(cookie.value).to eq "off,0,0,1"
144
+ expect(cookie.domain).to eq ".excite.co.jp"
145
+ expect(cookie.expires).to eq Time.gm(2037,12,31,12,0,0)
146
+ expect(cookie.path).to eq "/"
147
+
148
+ expect(cookie.secure?).to be_falsey
149
+ expect(cookie.http_only?).to be_falsey
150
150
  end
151
151
 
152
152
  it 'parse3' do
153
153
  str = "xmen=off,0,0,1; path=/; domain=.excite.co.jp; expires=Wednesday, 31-Dec-2037 12:00:00 GMT;Secure;HTTPOnly"
154
154
  @cm.parse(str, urify('http://www.excite.co.jp'))
155
155
  cookie = @cm.cookies[0]
156
- cookie.should be_an_instance_of WebAgent::Cookie
157
- cookie.name.should eq "xmen"
158
- cookie.value.should eq "off,0,0,1"
159
- cookie.domain.should eq ".excite.co.jp"
160
- cookie.expires.should eq Time.gm(2037,12,31,12,0,0)
161
- cookie.path.should eq "/"
162
- cookie.secure?.should be_true
163
- cookie.http_only?.should be_true
156
+ expect(cookie).to be_an_instance_of WebAgent::Cookie
157
+ expect(cookie.name).to eq "xmen"
158
+ expect(cookie.value).to eq "off,0,0,1"
159
+ expect(cookie.domain).to eq ".excite.co.jp"
160
+ expect(cookie.expires).to eq Time.gm(2037,12,31,12,0,0)
161
+ expect(cookie.path).to eq "/"
162
+ expect(cookie.secure?).to be_truthy
163
+ expect(cookie.http_only?).to be_truthy
164
164
  end
165
165
 
166
166
  it 'parse_double_semicolon' do
167
167
  str = "xmen=off,0,0,1;; path=\"/;;\"; domain=.excite.co.jp; expires=Wednesday, 31-Dec-2037 12:00:00 GMT"
168
168
  @cm.parse(str, urify('http://www.excite.co.jp'))
169
169
  cookie = @cm.cookies[0]
170
- cookie.should be_an_instance_of WebAgent::Cookie
171
- cookie.name.should eq "xmen"
172
- cookie.value.should eq "off,0,0,1"
173
- cookie.domain.should eq ".excite.co.jp"
174
- cookie.expires.should eq Time.gm(2037,12,31,12,0,0)
175
- cookie.path.should eq "/;;"
170
+ expect(cookie).to be_an_instance_of WebAgent::Cookie
171
+ expect(cookie.name).to eq "xmen"
172
+ expect(cookie.value).to eq "off,0,0,1"
173
+ expect(cookie.domain).to eq ".excite.co.jp"
174
+ expect(cookie.expires).to eq Time.gm(2037,12,31,12,0,0)
175
+ expect(cookie.path).to eq "/;;"
176
176
  end
177
177
 
178
178
  it 'check_expired_cookies' do
@@ -188,58 +188,58 @@ describe 'CookieManager' do
188
188
  @cm.cookies = cookies
189
189
  @cm.check_expired_cookies()
190
190
  # expires == nil cookies (session cookie) exists.
191
- @cm.cookies.should eq [c2,c4]
191
+ expect(@cm.cookies).to eq [c2,c4]
192
192
  end
193
193
 
194
194
  it 'parse_expires' do
195
195
  str = "inkid=n92b0ADOgACIgUb9lsjHqAAAHu2a; expires=; path=/"
196
196
  @cm.parse(str, urify('http://www.test.jp'))
197
197
  cookie = @cm.cookies[0]
198
- cookie.should be_an_instance_of WebAgent::Cookie
199
- cookie.name.should eq "inkid"
200
- cookie.value.should eq "n92b0ADOgACIgUb9lsjHqAAAHu2a"
201
- cookie.expires.should be_nil
202
- cookie.path.should eq "/"
198
+ expect(cookie).to be_an_instance_of WebAgent::Cookie
199
+ expect(cookie.name).to eq "inkid"
200
+ expect(cookie.value).to eq "n92b0ADOgACIgUb9lsjHqAAAHu2a"
201
+ expect(cookie.expires).to be_nil
202
+ expect(cookie.path).to eq "/"
203
203
 
204
204
  str = "inkid=n92b0ADOgACIgUb9lsjHqAAAHu2a; path=/; expires="
205
205
  @cm.parse(str, urify('http://www.test.jp'))
206
206
  cookie = @cm.cookies[0]
207
- cookie.should be_an_instance_of WebAgent::Cookie
208
- cookie.name.should eq "inkid"
209
- cookie.value.should eq "n92b0ADOgACIgUb9lsjHqAAAHu2a"
210
- cookie.expires.should be_nil
211
- cookie.path.should eq "/"
207
+ expect(cookie).to be_an_instance_of WebAgent::Cookie
208
+ expect(cookie.name).to eq "inkid"
209
+ expect(cookie.value).to eq "n92b0ADOgACIgUb9lsjHqAAAHu2a"
210
+ expect(cookie.expires).to be_nil
211
+ expect(cookie.path).to eq "/"
212
212
 
213
213
  str = "inkid=n92b0ADOgACIgUb9lsjHqAAAHu2a; path=/; expires=\"\""
214
214
  @cm.parse(str, urify('http://www.test.jp'))
215
215
  cookie = @cm.cookies[0]
216
- cookie.should be_an_instance_of WebAgent::Cookie
217
- cookie.name.should eq "inkid"
218
- cookie.value.should eq "n92b0ADOgACIgUb9lsjHqAAAHu2a"
219
- cookie.expires.should be_nil
220
- cookie.path.should eq "/"
216
+ expect(cookie).to be_an_instance_of WebAgent::Cookie
217
+ expect(cookie.name).to eq "inkid"
218
+ expect(cookie.value).to eq "n92b0ADOgACIgUb9lsjHqAAAHu2a"
219
+ expect(cookie.expires).to be_nil
220
+ expect(cookie.path).to eq "/"
221
221
  end
222
222
 
223
223
  it 'parse_after_expiration' do
224
224
  str = "inkid=n92b0ADOgACIgUb9lsjHqAAAHu2a; expires=Wed, 01-Dec-2010 00:00:00 GMT; path=/"
225
225
  @cm.parse(str, urify('http://www.test.jp'))
226
226
  cookie = @cm.cookies[0]
227
- cookie.should be_an_instance_of WebAgent::Cookie
228
- cookie.name.should eq "inkid"
229
- cookie.value.should eq "n92b0ADOgACIgUb9lsjHqAAAHu2a"
230
- cookie.expires.should eq Time.gm(2010, 12, 1, 0,0,0)
231
- cookie.path.should eq "/"
227
+ expect(cookie).to be_an_instance_of WebAgent::Cookie
228
+ expect(cookie.name).to eq "inkid"
229
+ expect(cookie.value).to eq "n92b0ADOgACIgUb9lsjHqAAAHu2a"
230
+ expect(cookie.expires).to eq Time.gm(2010, 12, 1, 0,0,0)
231
+ expect(cookie.path).to eq "/"
232
232
 
233
233
  time = Time.now.utc.round + 60
234
234
  expires = time.strftime("%a, %d-%b-%Y %H:%M:%S GMT")
235
235
  str = "inkid=n92b0ADOgACIgUb9lsjHqAAAHu2a; expires=#{expires}; path=/"
236
236
  @cm.parse(str, urify('http://www.test.jp'))
237
237
  cookie = @cm.cookies[0]
238
- cookie.should be_an_instance_of WebAgent::Cookie
239
- cookie.name.should eq "inkid"
240
- cookie.value.should eq "n92b0ADOgACIgUb9lsjHqAAAHu2a"
241
- cookie.expires.should eq time
242
- cookie.path.should eq "/"
238
+ expect(cookie).to be_an_instance_of WebAgent::Cookie
239
+ expect(cookie.name).to eq "inkid"
240
+ expect(cookie.value).to eq "n92b0ADOgACIgUb9lsjHqAAAHu2a"
241
+ expect(cookie.expires).to eq time
242
+ expect(cookie.path).to eq "/"
243
243
  end
244
244
 
245
245
  it 'find_cookie' do
@@ -254,7 +254,7 @@ describe 'CookieManager' do
254
254
 
255
255
  url = urify('http://www.excite.co.jp/hoge/funi/')
256
256
  cookie_str = @cm.find(url)
257
- cookie_str.should eq "xmen=off,0,0,2"
257
+ expect(cookie_str).to eq "xmen=off,0,0,2"
258
258
  end
259
259
 
260
260
  it 'load_cookies' do
@@ -271,24 +271,24 @@ EOF
271
271
  @cm.cookies_file = 'tmp_test.tmp'
272
272
  @cm.load_cookies()
273
273
  c0, c1, c2, c3 = @cm.cookies
274
- c0.url.to_s.should eq 'http://www.zdnet.co.jp/news/0106/08/e_gibson.html'
275
- c0.name.should eq 'NGUserID'
276
- c0.value.should eq 'd29b8f49-10875-992421294-1'
277
- c0.expires.should eq Time.at(2145801600)
278
- c0.domain.should eq 'www.zdnet.co.jp'
279
- c0.path.should eq '/'
280
- c0.flag.should eq 9
281
-
282
- c1.url.to_s.should eq 'http://www.zdnet.co.jp/news/0106/08/e_gibson.html'
283
- c1.name.should eq 'PACK'
284
- c1.value.should eq 'zd3-992421294-7436'
285
- c1.expires.should eq Time.at(1293839999)
286
- c1.domain.should eq '.zdnet.co.jp'
287
- c1.path.should eq '/'
288
- c1.flag.should eq 13
274
+ expect(c0.url.to_s).to eq 'http://www.zdnet.co.jp/news/0106/08/e_gibson.html'
275
+ expect(c0.name).to eq 'NGUserID'
276
+ expect(c0.value).to eq 'd29b8f49-10875-992421294-1'
277
+ expect(c0.expires).to eq Time.at(2145801600)
278
+ expect(c0.domain).to eq 'www.zdnet.co.jp'
279
+ expect(c0.path).to eq '/'
280
+ expect(c0.flag).to eq 9
281
+
282
+ expect(c1.url.to_s).to eq 'http://www.zdnet.co.jp/news/0106/08/e_gibson.html'
283
+ expect(c1.name).to eq 'PACK'
284
+ expect(c1.value).to eq 'zd3-992421294-7436'
285
+ expect(c1.expires).to eq Time.at(1293839999)
286
+ expect(c1.domain).to eq '.zdnet.co.jp'
287
+ expect(c1.path).to eq '/'
288
+ expect(c1.flag).to eq 13
289
289
  #
290
- c2.expires.should be_nil
291
- c3.expires.should be_nil
290
+ expect(c2.expires).to be_nil
291
+ expect(c3.expires).to be_nil
292
292
  ensure
293
293
  File.unlink("tmp_test.tmp")
294
294
  end
@@ -312,14 +312,14 @@ EOF
312
312
  File.open("tmp_test2.tmp","r") {|f|
313
313
  str2 = f.read()
314
314
  }
315
- str.should eq str2
315
+ expect(str).to eq str2
316
316
  #
317
- File.exist?('tmp_test2.tmp').should be_true
317
+ expect(File.exist?('tmp_test2.tmp')).to be_truthy
318
318
  File.unlink("tmp_test2.tmp")
319
319
  @cm.save_cookies()
320
- File.exist?('tmp_test2.tmp').should be_false
320
+ expect(File.exist?('tmp_test2.tmp')).to be_falsey
321
321
  @cm.save_cookies(true)
322
- File.exist?('tmp_test2.tmp').should be_true
322
+ expect(File.exist?('tmp_test2.tmp')).to be_truthy
323
323
  ensure
324
324
  File.unlink("tmp_test.tmp")
325
325
  if FileTest.exist?("tmp_test2.tmp")
@@ -339,7 +339,7 @@ EOF
339
339
  @cm.parse("quxx=5; path=/; expires=#{(Time.now - 10).asctime}", uri)
340
340
  @cm.save_cookies()
341
341
  @cm.load_cookies
342
- @cm.cookies.size.should eq 1
342
+ expect(@cm.cookies.size).to eq 1
343
343
  ensure
344
344
  File.unlink("tmp_test.tmp") if File.exist?("tmp_test.tmp")
345
345
  end
@@ -352,9 +352,9 @@ EOF
352
352
  c.url = urify("http://www.inac.co.jp/hoge")
353
353
  @cm.add(c)
354
354
  c = @cm.cookies[0]
355
- c.name.should eq 'hoge'
356
- c.value.should eq 'funi'
357
- c.expires.should be_nil
355
+ expect(c.name).to eq 'hoge'
356
+ expect(c.value).to eq 'funi'
357
+ expect(c.expires).to be_nil
358
358
  end
359
359
 
360
360
  it 'add2' do
@@ -373,26 +373,26 @@ EOF
373
373
  @cm.add(c)
374
374
  #
375
375
  c1, c2 = @cm.cookies
376
- c1.path.should eq ''
377
- c2.path.should eq '/hoge/hoge2'
376
+ expect(c1.path).to eq ''
377
+ expect(c2.path).to eq '/hoge/hoge2'
378
378
  end
379
379
 
380
380
  it 'test_check_cookie_accept_domain' do
381
381
  @cm.accept_domains = [".example1.co.jp", "www1.example.jp"]
382
382
  @cm.reject_domains = [".example2.co.jp", "www2.example.jp"]
383
383
  check1 = @cm.check_cookie_accept_domain("www.example1.co.jp")
384
- check1.should be_true
384
+ expect(check1).to be_truthy
385
385
  check2 = @cm.check_cookie_accept_domain("www.example2.co.jp")
386
- check2.should be_false
386
+ expect(check2).to be_falsey
387
387
  check3 = @cm.check_cookie_accept_domain("www1.example.jp")
388
- check3.should be_true
388
+ expect(check3).to be_truthy
389
389
  check4 = @cm.check_cookie_accept_domain("www2.example.jp")
390
- check4.should be_false
390
+ expect(check4).to be_falsey
391
391
  check5 = @cm.check_cookie_accept_domain("aa.www2.example.jp")
392
- check5.should be_true
392
+ expect(check5).to be_truthy
393
393
  check6 = @cm.check_cookie_accept_domain("aa.www2.example.jp")
394
- check6.should be_true
395
- @cm.check_cookie_accept_domain(nil).should be_false
394
+ expect(check6).to be_truthy
395
+ expect(@cm.check_cookie_accept_domain(nil)).to be_falsey
396
396
  end
397
397
 
398
398
  end
data/spec/hexdump_spec.rb CHANGED
@@ -6,6 +6,6 @@ describe 'HexDump' do
6
6
  it 'encode' do
7
7
  str = "\032l\277\370\2429\216\236\351[{\{\262\350\274\376"
8
8
  str.force_encoding('BINARY') if str.respond_to?(:force_encoding)
9
- HexDump.encode(str).should eq ["00000000 1a6cbff8 a2398e9e e95b7b7b b2e8bcfe .l...9...[{{...."]
9
+ expect(HexDump.encode(str)).to eq ["00000000 1a6cbff8 a2398e9e e95b7b7b b2e8bcfe .l...9...[{{...."]
10
10
  end
11
11
  end