jpmobile 4.1.1 → 4.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/jpmobile.gemspec +2 -0
  3. data/lib/jpmobile/emoticon.rb +3 -3
  4. data/lib/jpmobile/filter.rb +1 -1
  5. data/lib/jpmobile/mail.rb +3 -3
  6. data/lib/jpmobile/mobile/abstract_mobile.rb +5 -2
  7. data/lib/jpmobile/resolver.rb +17 -1
  8. data/lib/jpmobile/version.rb +1 -1
  9. data/lib/tasks/jpmobile_tasks.rake +5 -11
  10. data/spec/rack/jpmobile/android_spec.rb +4 -4
  11. data/spec/rack/jpmobile/au_spec.rb +46 -46
  12. data/spec/rack/jpmobile/black_berry_spec.rb +4 -4
  13. data/spec/rack/jpmobile/docomo_spec.rb +52 -52
  14. data/spec/rack/jpmobile/emoticon_spec.rb +67 -67
  15. data/spec/rack/jpmobile/filter_spec.rb +36 -36
  16. data/spec/rack/jpmobile/iphone_spec.rb +5 -5
  17. data/spec/rack/jpmobile/mobile_by_ua_spec.rb +2 -2
  18. data/spec/rack/jpmobile/params_filter_spec.rb +30 -30
  19. data/spec/rack/jpmobile/softbank_spec.rb +39 -39
  20. data/spec/rack/jpmobile/willcom_spec.rb +12 -12
  21. data/spec/rack/jpmobile/windows_phone.rb +4 -4
  22. data/spec/unit/decorated_mail_spec.rb +3 -3
  23. data/spec/unit/email_spec.rb +6 -6
  24. data/spec/unit/emoticon_spec.rb +33 -33
  25. data/spec/unit/encoding_spec.rb +14 -14
  26. data/spec/unit/is_carrier_spec.rb +1 -1
  27. data/spec/unit/mail_spec.rb +63 -63
  28. data/spec/unit/mobile/iphone_spec.rb +6 -6
  29. data/spec/unit/receive_mail_spec.rb +75 -75
  30. data/spec/unit/util_spec.rb +34 -34
  31. data/spec/unit/valid_ip_spec.rb +2 -2
  32. data/spec/unit/variants_spec.rb +40 -10
  33. data/test/rails/overrides/Gemfile +3 -3
  34. data/test/rails/overrides/spec/controllers/docomo_guid_spec.rb +6 -6
  35. data/test/rails/overrides/spec/controllers/helpers_spec.rb +22 -22
  36. data/test/rails/overrides/spec/controllers/mobile_spec_controller_spec.rb +19 -19
  37. data/test/rails/overrides/spec/controllers/template_path_spec.rb +8 -8
  38. data/test/rails/overrides/spec/controllers/trans_sid_controller_spec.rb +2 -2
  39. data/test/rails/overrides/spec/features/admin/top_spec.rb +3 -3
  40. data/test/rails/overrides/spec/features/filter_spec.rb +32 -32
  41. data/test/rails/overrides/spec/helpers/helpers_spec.rb +3 -3
  42. data/test/rails/overrides/spec/mailers/decorated_mailer_spec.rb +3 -3
  43. data/test/rails/overrides/spec/mailers/mobile_mailer_spec.rb +179 -179
  44. data/test/rails/overrides/spec/mailers/normal_mailer_spec.rb +7 -7
  45. data/test/rails/overrides/spec/requests/docomo_spec.rb +6 -6
  46. data/test/rails/overrides/spec/requests/emobile_spec.rb +6 -6
  47. data/test/rails/overrides/spec/requests/pc_spec.rb +3 -3
  48. data/test/rails/overrides/spec/requests/softbank_emulator_spec.rb +6 -6
  49. data/test/rails/overrides/spec/requests/template_path_spec.rb +24 -24
  50. data/test/rails/overrides/spec/requests/trans_sid_spec.rb +16 -16
  51. metadata +39 -25
@@ -11,13 +11,13 @@ describe "Jpmobile::Mobile" do
11
11
 
12
12
  context "to_mail_subject" do
13
13
  it "should convert string to ISO-2022-JP B-Encoding when string contains Japanese" do
14
- @mobile.to_mail_subject("ほげ").should == "=?ISO-2022-JP?B?GyRCJFskMhsoQg==?="
14
+ expect(@mobile.to_mail_subject("ほげ")).to eq("=?ISO-2022-JP?B?GyRCJFskMhsoQg==?=")
15
15
  end
16
16
  end
17
17
 
18
18
  context "to_mail_body" do
19
19
  it "should convert string to ISO-2022-JP when string contains Japanese" do
20
- @mobile.to_mail_body("ほげ").should == utf8_to_jis("ほげ")
20
+ expect(@mobile.to_mail_body("ほげ")).to eq(utf8_to_jis("ほげ"))
21
21
  end
22
22
  end
23
23
  end
@@ -29,21 +29,21 @@ describe "Jpmobile::Mobile" do
29
29
 
30
30
  context "to_mail_subject" do
31
31
  it "should convert string to Shift_JIS B-Encoding when string contains Japanese" do
32
- @mobile.to_mail_subject("ほげ").should == "=?Shift_JIS?B?gtmCsA==?="
32
+ expect(@mobile.to_mail_subject("ほげ")).to eq("=?Shift_JIS?B?gtmCsA==?=")
33
33
  end
34
34
 
35
35
  it "should convert emoticon  to \xf8\x9f in B-Encoding" do
36
- @mobile.to_mail_subject("ほげ").should == "=?Shift_JIS?B?gtmCsPif?="
36
+ expect(@mobile.to_mail_subject("ほげ")).to eq("=?Shift_JIS?B?gtmCsPif?=")
37
37
  end
38
38
  end
39
39
 
40
40
  context "to_mail_body" do
41
41
  it "should convert string to Shift_JIS when string contains Japanese" do
42
- @mobile.to_mail_body("ほげ").should == utf8_to_sjis("ほげ")
42
+ expect(@mobile.to_mail_body("ほげ")).to eq(utf8_to_sjis("ほげ"))
43
43
  end
44
44
 
45
45
  it "should convert emoticon  to \xf8\x9f" do
46
- @mobile.to_mail_body("ほげ").should == utf8_to_sjis("ほげ") + sjis("\xf8\x9f")
46
+ expect(@mobile.to_mail_body("ほげ")).to eq(utf8_to_sjis("ほげ") + sjis("\xf8\x9f"))
47
47
  end
48
48
  end
49
49
  end
@@ -55,21 +55,21 @@ describe "Jpmobile::Mobile" do
55
55
 
56
56
  context "to_mail_subject" do
57
57
  it "should convert string to ISO-2022-JP B-Encoding when string contains Japanese" do
58
- @mobile.to_mail_subject("ほげ").should == "=?ISO-2022-JP?B?GyRCJFskMhsoQg==?="
58
+ expect(@mobile.to_mail_subject("ほげ")).to eq("=?ISO-2022-JP?B?GyRCJFskMhsoQg==?=")
59
59
  end
60
60
 
61
61
  it "should convert emoticon  to \x75\x41 in B-Encoding" do
62
- @mobile.to_mail_subject("ほげ").should == "=?ISO-2022-JP?B?GyRCJFskMnVBGyhC?="
62
+ expect(@mobile.to_mail_subject("ほげ")).to eq("=?ISO-2022-JP?B?GyRCJFskMnVBGyhC?=")
63
63
  end
64
64
  end
65
65
 
66
66
  context "to_mail_body" do
67
67
  it "should convert string to ISO-2022-JP when string contains Japanese" do
68
- @mobile.to_mail_body("ほげ").should == utf8_to_jis("ほげ")
68
+ expect(@mobile.to_mail_body("ほげ")).to eq(utf8_to_jis("ほげ"))
69
69
  end
70
70
 
71
71
  it "should convert emoticon  to \x75\x41" do
72
- ascii_8bit(@mobile.to_mail_body("ほげ")).should == ascii_8bit(jis("\e\x24\x42\x24\x5B\x24\x32\x75\x41\x1b\x28\x42"))
72
+ expect(ascii_8bit(@mobile.to_mail_body("ほげ"))).to eq(ascii_8bit(jis("\e\x24\x42\x24\x5B\x24\x32\x75\x41\x1b\x28\x42")))
73
73
  end
74
74
  end
75
75
  end
@@ -81,21 +81,21 @@ describe "Jpmobile::Mobile" do
81
81
 
82
82
  context "to_mail_subject" do
83
83
  it "should convert string to Shift_JIS B-Encoding when string contains Japanese" do
84
- @mobile.to_mail_subject("ほげ").should == "=?Shift_JIS?B?gtmCsA==?="
84
+ expect(@mobile.to_mail_subject("ほげ")).to eq("=?Shift_JIS?B?gtmCsA==?=")
85
85
  end
86
86
 
87
87
  it "should convert emoticon  to \xf9\x8b in B-Encoding" do
88
- @mobile.to_mail_subject("ほげ").should == "=?Shift_JIS?B?gtmCsPmL?="
88
+ expect(@mobile.to_mail_subject("ほげ")).to eq("=?Shift_JIS?B?gtmCsPmL?=")
89
89
  end
90
90
  end
91
91
 
92
92
  context "to_mail_body" do
93
93
  it "should convert string to Shift_JIS when string contains Japanese" do
94
- @mobile.to_mail_body("ほげ").should == utf8_to_sjis("ほげ")
94
+ expect(@mobile.to_mail_body("ほげ")).to eq(utf8_to_sjis("ほげ"))
95
95
  end
96
96
 
97
97
  it "should convert emoticon  to \xf9\x8b" do
98
- @mobile.to_mail_body("ほげ").should == utf8_to_sjis("ほげ") + sjis("\xf9\x8b")
98
+ expect(@mobile.to_mail_body("ほげ")).to eq(utf8_to_sjis("ほげ") + sjis("\xf9\x8b"))
99
99
  end
100
100
  end
101
101
  end
@@ -59,7 +59,7 @@ describe 'Jpmobile::Mobile' do
59
59
  [ %w[ Ddipocket ddipocket ] , true ],
60
60
  ].each do |carrier, expected|
61
61
  it "#{carrier.first}##{carrier.last}? should be return #{expected}" do
62
- Jpmobile::Mobile.const_get(carrier.first).new({}, {}).__send__("#{carrier.last}?").should == expected
62
+ expect(Jpmobile::Mobile.const_get(carrier.first).new({}, {}).__send__("#{carrier.last}?")).to eq(expected)
63
63
  end
64
64
  end
65
65
  end
@@ -53,23 +53,23 @@ describe "Jpmobile::Mail" do
53
53
 
54
54
  context "to_s" do
55
55
  it "should contain encoded subject" do
56
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCS3xNVRsoQg==?=")))
56
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCS3xNVRsoQg==?=")))
57
57
  end
58
58
 
59
59
  it "should contain encoded body" do
60
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape(ascii_8bit("\x1b\x24\x42\x24\x5B\x24\x32\e\x28\x42"))))
60
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape(ascii_8bit("\x1b\x24\x42\x24\x5B\x24\x32\e\x28\x42"))))
61
61
  end
62
62
 
63
63
  it "should contain encoded from"do
64
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape(ascii_8bit("=?ISO-2022-JP?B?GyRCJEEkTyRkJFUkaxsoQg==?="))))
64
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape(ascii_8bit("=?ISO-2022-JP?B?GyRCJEEkTyRkJFUkaxsoQg==?="))))
65
65
  end
66
66
 
67
67
  it "should contain encoded to" do
68
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape(ascii_8bit("=?ISO-2022-JP?B?GyRCJGAkOSRhJFUkNSRbJDsbKEI=?="))))
68
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape(ascii_8bit("=?ISO-2022-JP?B?GyRCJGAkOSRhJFUkNSRbJDsbKEI=?="))))
69
69
  end
70
70
 
71
71
  it "should contain correct Content-Type:" do
72
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape(ascii_8bit("charset=ISO-2022-JP"))))
72
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape(ascii_8bit("charset=ISO-2022-JP"))))
73
73
  end
74
74
  end
75
75
  end
@@ -83,27 +83,27 @@ describe "Jpmobile::Mail" do
83
83
 
84
84
  context "to_s" do
85
85
  it "should contain encoded subject" do
86
- @mail.to_s.should match(sjis_regexp("=?Shift_JIS?B?lpyXdA==?="))
86
+ expect(@mail.to_s).to match(sjis_regexp("=?Shift_JIS?B?lpyXdA==?="))
87
87
  end
88
88
 
89
89
  it "should contain encoded body" do
90
- @mail.to_s.should match(Regexp.escape(utf8_to_sjis("ほげ")))
90
+ expect(@mail.to_s).to match(Regexp.escape(utf8_to_sjis("ほげ")))
91
91
  end
92
92
 
93
93
  it "should contain encoded from" do
94
- @mail.to_s.should match(sjis_regexp("gr+CzYLigtOC6Q=="))
94
+ expect(@mail.to_s).to match(sjis_regexp("gr+CzYLigtOC6Q=="))
95
95
  end
96
96
 
97
97
  it "should contain encoded to" do
98
- @mail.to_s.should match(sjis_regexp("gt6Ct4LfgtOCs4LZgrk="))
98
+ expect(@mail.to_s).to match(sjis_regexp("gt6Ct4LfgtOCs4LZgrk="))
99
99
  end
100
100
 
101
101
  it "should contains encoded emoticon" do
102
102
  @mail.subject += ""
103
103
  @mail.body = "#{@mail.body}"
104
104
 
105
- @mail.to_s.should match(Regexp.escape("=?Shift_JIS?B?lpyXdPif?="))
106
- @mail.to_s.should match(sjis_regexp("\xF8\x9F"))
105
+ expect(@mail.to_s).to match(Regexp.escape("=?Shift_JIS?B?lpyXdPif?="))
106
+ expect(@mail.to_s).to match(sjis_regexp("\xF8\x9F"))
107
107
  end
108
108
  end
109
109
  end
@@ -117,27 +117,27 @@ describe "Jpmobile::Mail" do
117
117
 
118
118
  context "to_s" do
119
119
  it "should contain encoded subject" do
120
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCS3xNVRsoQg==?=")))
120
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCS3xNVRsoQg==?=")))
121
121
  end
122
122
 
123
123
  it "should contain encoded body" do
124
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape(ascii_8bit("\x1b\x24\x42\x24\x5B\x24\x32\e\x28\x42"))))
124
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape(ascii_8bit("\x1b\x24\x42\x24\x5B\x24\x32\e\x28\x42"))))
125
125
  end
126
126
 
127
127
  it "should contain encoded from" do
128
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape(ascii_8bit("=?ISO-2022-JP?B?GyRCJEEkTyRkJFUkaxsoQg==?="))))
128
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape(ascii_8bit("=?ISO-2022-JP?B?GyRCJEEkTyRkJFUkaxsoQg==?="))))
129
129
  end
130
130
 
131
131
  it "should contain encoded to" do
132
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape(ascii_8bit("=?ISO-2022-JP?B?GyRCJGAkOSRhJFUkNSRbJDsbKEI=?="))))
132
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape(ascii_8bit("=?ISO-2022-JP?B?GyRCJGAkOSRhJFUkNSRbJDsbKEI=?="))))
133
133
  end
134
134
 
135
135
  it "should contain encoded emoticon" do
136
136
  @mail.subject += ""
137
137
  @mail.body = "#{@mail.body}"
138
138
 
139
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCS3xNVXVBGyhC?=")))
140
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape(ascii_8bit("\e\x24\x42\x24\x5B\x24\x32\x75\x41\e\x28\x42"))))
139
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCS3xNVXVBGyhC?=")))
140
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape(ascii_8bit("\e\x24\x42\x24\x5B\x24\x32\x75\x41\e\x28\x42"))))
141
141
  end
142
142
  end
143
143
  end
@@ -151,27 +151,27 @@ describe "Jpmobile::Mail" do
151
151
 
152
152
  context "to_s" do
153
153
  it "should contain encoded subject" do
154
- @mail.to_s.should match(Regexp.escape(sjis("=?Shift_JIS?B?lpyXdA==?=")))
154
+ expect(@mail.to_s).to match(Regexp.escape(sjis("=?Shift_JIS?B?lpyXdA==?=")))
155
155
  end
156
156
 
157
157
  it "should contain encoded body" do
158
- @mail.to_s.should match(Regexp.escape(utf8_to_sjis("ほげ")))
158
+ expect(@mail.to_s).to match(Regexp.escape(utf8_to_sjis("ほげ")))
159
159
  end
160
160
 
161
161
  it "should contain encoded from" do
162
- @mail.to_s.should match(sjis_regexp("gr+CzYLigtOC6Q=="))
162
+ expect(@mail.to_s).to match(sjis_regexp("gr+CzYLigtOC6Q=="))
163
163
  end
164
164
 
165
165
  it "should contain encoded to" do
166
- @mail.to_s.should match(sjis_regexp("gt6Ct4LfgtOCs4LZgrk="))
166
+ expect(@mail.to_s).to match(sjis_regexp("gt6Ct4LfgtOCs4LZgrk="))
167
167
  end
168
168
 
169
169
  it "should contains encoded emoticon" do
170
170
  @mail.subject += ""
171
171
  @mail.body = "#{@mail.body}"
172
172
 
173
- @mail.to_s.should match(Regexp.escape("=?Shift_JIS?B?lpyXdPmL?="))
174
- @mail.to_s.should match(sjis_regexp("\xf9\x8b"))
173
+ expect(@mail.to_s).to match(Regexp.escape("=?Shift_JIS?B?lpyXdPmL?="))
174
+ expect(@mail.to_s).to match(sjis_regexp("\xf9\x8b"))
175
175
  end
176
176
  end
177
177
  end
@@ -192,12 +192,12 @@ describe "Jpmobile::Mail" do
192
192
  end
193
193
 
194
194
  it "should contain encoded subject" do
195
- @mail.to_s.should match(sjis_regexp("=?Shift_JIS?B?lb6O0I3Ml3CJnpXlgtaCzIKokFyNnoLdkL2CyYKg?="))
196
- @mail.to_s.should match(sjis_regexp("=?Shift_JIS?B?guiCqoLGgqSCsoK0gqKC3IK3gsaMvoKigr2CooLG?="))
197
- @mail.to_s.should match(sjis_regexp("=?Shift_JIS?B?grGC64K+gqqCu4Kkgs2KyJJQgsmCzZWojpaCzYle?="))
198
- @mail.to_s.should match(sjis_regexp("=?Shift_JIS?B?gs6CyIKigrGCxoLwkFOCtYLEgqiCooLEguCC54Ki?="))
199
- @mail.to_s.should match(sjis_regexp("=?Shift_JIS?B?gr2CooLGi+qMvoLwkuaCt4LpjMyCyZW+jtCCzYjb?="))
200
- @mail.to_s.should match(sjis_regexp("=?Shift_JIS?B?jp2CtYLEgqKC6YLMgsWCtw==?="))
195
+ expect(@mail.to_s).to match(sjis_regexp("=?Shift_JIS?B?lb6O0I3Ml3CJnpXlgtaCzIKokFyNnoLdkL2CyYKg?="))
196
+ expect(@mail.to_s).to match(sjis_regexp("=?Shift_JIS?B?guiCqoLGgqSCsoK0gqKC3IK3gsaMvoKigr2CooLG?="))
197
+ expect(@mail.to_s).to match(sjis_regexp("=?Shift_JIS?B?grGC64K+gqqCu4Kkgs2KyJJQgsmCzZWojpaCzYle?="))
198
+ expect(@mail.to_s).to match(sjis_regexp("=?Shift_JIS?B?gs6CyIKigrGCxoLwkFOCtYLEgqiCooLEguCC54Ki?="))
199
+ expect(@mail.to_s).to match(sjis_regexp("=?Shift_JIS?B?gr2CooLGi+qMvoLwkuaCt4LpjMyCyZW+jtCCzYjb?="))
200
+ expect(@mail.to_s).to match(sjis_regexp("=?Shift_JIS?B?jp2CtYLEgqKC6YLMgsWCtw==?="))
201
201
  end
202
202
  end
203
203
 
@@ -209,12 +209,12 @@ describe "Jpmobile::Mail" do
209
209
  end
210
210
 
211
211
  it "should contain encoded subject" do
212
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCSkA8UjpOTVExfkpnJFgkTiQqPz05fiRfQD8kSyQiGyhC?=")))
213
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCJGokLCRIJCYkNCQ2JCQkXiQ5JEg4QCQkJD8kJCRIGyhC?=")))
214
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCJDMkbSRAJCwkPSQmJE80SkMxJEskT0oqO3YkTzE/GyhC?=")))
215
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCJFAkSiQkJDMkSCRyPzQkNyRGJCokJCRGJGIkaSQkGyhC?=")))
216
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCJD8kJCRINmw4QCRyRGgkOSRrOE4kS0pAPFIkTzBdGyhC?=")))
217
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCO30kNyRGJCQkayROJEckORsoQg==?=")))
212
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCSkA8UjpOTVExfkpnJFgkTiQqPz05fiRfQD8kSyQiGyhC?=")))
213
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCJGokLCRIJCYkNCQ2JCQkXiQ5JEg4QCQkJD8kJCRIGyhC?=")))
214
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCJDMkbSRAJCwkPSQmJE80SkMxJEskT0oqO3YkTzE/GyhC?=")))
215
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCJFAkSiQkJDMkSCRyPzQkNyRGJCokJCRGJGIkaSQkGyhC?=")))
216
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCJD8kJCRINmw4QCRyRGgkOSRrOE4kS0pAPFIkTzBdGyhC?=")))
217
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCO30kNyRGJCQkayROJEckORsoQg==?=")))
218
218
  end
219
219
  end
220
220
 
@@ -226,12 +226,12 @@ describe "Jpmobile::Mail" do
226
226
  end
227
227
 
228
228
  it "should contain encoded subject" do
229
- @mail.to_s.should match(sjis_regexp("=?Shift_JIS?B?lb6O0I3Ml3CJnpXlgtaCzIKokFyNnoLdkL2CyYKg?="))
230
- @mail.to_s.should match(sjis_regexp("=?Shift_JIS?B?guiCqoLGgqSCsoK0gqKC3IK3gsaMvoKigr2CooLG?="))
231
- @mail.to_s.should match(sjis_regexp("=?Shift_JIS?B?grGC64K+gqqCu4Kkgs2KyJJQgsmCzZWojpaCzYle?="))
232
- @mail.to_s.should match(sjis_regexp("=?Shift_JIS?B?gs6CyIKigrGCxoLwkFOCtYLEgqiCooLEguCC54Ki?="))
233
- @mail.to_s.should match(sjis_regexp("=?Shift_JIS?B?gr2CooLGi+qMvoLwkuaCt4LpjMyCyZW+jtCCzYjb?="))
234
- @mail.to_s.should match(sjis_regexp("=?Shift_JIS?B?jp2CtYLEgqKC6YLMgsWCtw==?="))
229
+ expect(@mail.to_s).to match(sjis_regexp("=?Shift_JIS?B?lb6O0I3Ml3CJnpXlgtaCzIKokFyNnoLdkL2CyYKg?="))
230
+ expect(@mail.to_s).to match(sjis_regexp("=?Shift_JIS?B?guiCqoLGgqSCsoK0gqKC3IK3gsaMvoKigr2CooLG?="))
231
+ expect(@mail.to_s).to match(sjis_regexp("=?Shift_JIS?B?grGC64K+gqqCu4Kkgs2KyJJQgsmCzZWojpaCzYle?="))
232
+ expect(@mail.to_s).to match(sjis_regexp("=?Shift_JIS?B?gs6CyIKigrGCxoLwkFOCtYLEgqiCooLEguCC54Ki?="))
233
+ expect(@mail.to_s).to match(sjis_regexp("=?Shift_JIS?B?gr2CooLGi+qMvoLwkuaCt4LpjMyCyZW+jtCCzYjb?="))
234
+ expect(@mail.to_s).to match(sjis_regexp("=?Shift_JIS?B?jp2CtYLEgqKC6YLMgsWCtw==?="))
235
235
  end
236
236
  end
237
237
 
@@ -244,12 +244,12 @@ describe "Jpmobile::Mail" do
244
244
 
245
245
  context "to_s" do
246
246
  it "should contain encoded subject" do
247
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCSkA8UjpOTVExfkpnJFgkTiQqPz05fiRfQD8kSyQiGyhC?=")))
248
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCJGokLCRIJCYkNCQ2JCQkXiQ5JEg4QCQkJD8kJCRIGyhC?=")))
249
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCJDMkbSRAJCwkPSQmJE80SkMxJEskT0oqO3YkTzE/GyhC?=")))
250
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCJFAkSiQkJDMkSCRyPzQkNyRGJCokJCRGJGIkaSQkGyhC?=")))
251
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCJD8kJCRINmw4QCRyRGgkOSRrOE4kS0pAPFIkTzBdGyhC?=")))
252
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCO30kNyRGJCQkayROJEckORsoQg==?=")))
247
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCSkA8UjpOTVExfkpnJFgkTiQqPz05fiRfQD8kSyQiGyhC?=")))
248
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCJGokLCRIJCYkNCQ2JCQkXiQ5JEg4QCQkJD8kJCRIGyhC?=")))
249
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCJDMkbSRAJCwkPSQmJE80SkMxJEskT0oqO3YkTzE/GyhC?=")))
250
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCJFAkSiQkJDMkSCRyPzQkNyRGJCokJCRGJGIkaSQkGyhC?=")))
251
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCJD8kJCRINmw4QCRyRGgkOSRrOE4kS0pAPFIkTzBdGyhC?=")))
252
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCO30kNyRGJCQkayROJEckORsoQg==?=")))
253
253
  end
254
254
  end
255
255
  end
@@ -272,9 +272,9 @@ describe "Jpmobile::Mail" do
272
272
 
273
273
  context "to_s" do
274
274
  it "should contain encoded subject" do
275
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCQD5OcRsoQjIwMTIbJEJHLxsoQjA5GyRCN24bKEIwMxskQkZ8JE86IxsoQg==?=")))
276
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCRnwkSyRKJGskbyQxJEAkLBsoQjEwGyRCO34bKEIxNhskQkosOD0bKEI=?=")))
277
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCOl8kTiQzJE47fjRWJEckTyRJJCYkKyRKGyhC?=")))
275
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCQD5OcRsoQjIwMTIbJEJHLxsoQjA5GyRCN24bKEIwMxskQkZ8JE86IxsoQg==?=")))
276
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCRnwkSyRKJGskbyQxJEAkLBsoQjEwGyRCO34bKEIxNhskQkosOD0bKEI=?=")))
277
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCOl8kTiQzJE47fjRWJEckTyRJJCYkKyRKGyhC?=")))
278
278
  end
279
279
  end
280
280
  end
@@ -291,25 +291,25 @@ describe "Jpmobile::Mail" do
291
291
  it "should encodes itself successfully" do
292
292
  @mail.attachments['photo.jpg'] = @photo
293
293
 
294
- lambda {
294
+ expect {
295
295
  @mail.to_s
296
- }.should_not raise_error
296
+ }.not_to raise_error
297
297
  end
298
298
 
299
299
  it "should encodes itself successfully with an inline attachment" do
300
300
  @mail.attachments.inline['photo.jpg'] = @photo
301
301
 
302
- lambda {
302
+ expect {
303
303
  @mail.to_s
304
- }.should_not raise_error
304
+ }.not_to raise_error
305
305
  end
306
306
 
307
307
  it "should encodes itself successfully with an UTF-8 filename attachment" do
308
308
  @mail.attachments.inline['日本語のファイル名です.jpg'] = @photo
309
309
 
310
- lambda {
310
+ expect {
311
311
  @mail.to_s
312
- }.should_not raise_error
312
+ }.not_to raise_error
313
313
  end
314
314
  end
315
315
 
@@ -324,13 +324,13 @@ describe "Jpmobile::Mail" do
324
324
  it "wave dash converting correctly" do
325
325
  @mail.body = '10:00〜12:00'
326
326
 
327
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape(ascii_8bit("\x31\x30\x3a\x30\x30\x1b\x24\x42\x21\x41\x1b\x28\x42\x31\x32\x3a\x30\x30"))))
327
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape(ascii_8bit("\x31\x30\x3a\x30\x30\x1b\x24\x42\x21\x41\x1b\x28\x42\x31\x32\x3a\x30\x30"))))
328
328
  end
329
329
 
330
330
  it "full width tilde converting correctly" do
331
331
  @mail.body = "10:00#{[0xff5e].pack("U")}12:00"
332
332
 
333
- ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape(ascii_8bit("\x31\x30\x3a\x30\x30\x1b\x24\x42\x21\x41\x1b\x28\x42\x31\x32\x3a\x30\x30"))))
333
+ expect(ascii_8bit(@mail.to_s)).to match(Regexp.compile(Regexp.escape(ascii_8bit("\x31\x30\x3a\x30\x30\x1b\x24\x42\x21\x41\x1b\x28\x42\x31\x32\x3a\x30\x30"))))
334
334
  end
335
335
  end
336
336
 
@@ -343,9 +343,9 @@ describe "Jpmobile::Mail" do
343
343
 
344
344
  it "delivers through SMTP" do
345
345
  @mail.delivery_method :smtp, {:enable_starttls_auto => false}
346
- lambda {
346
+ expect {
347
347
  @mail.deliver
348
- }.should_not raise_error
348
+ }.not_to raise_error
349
349
 
350
350
  Mail::TestMailer.deliveries.size
351
351
  end
@@ -367,7 +367,7 @@ describe "Jpmobile::Mail" do
367
367
  @mail.mobile = mobile
368
368
  @mail.from = '<えーゆー> au@ezweb.ne.jp'
369
369
 
370
- @mail.encoded.should match(/content-transfer-encoding: 7bit/i)
370
+ expect(@mail.encoded).to match(/content-transfer-encoding: 7bit/i)
371
371
  end
372
372
 
373
373
  it 'should not convert content-transfer-encoding with BINARY' do
@@ -382,8 +382,8 @@ describe "Jpmobile::Mail" do
382
382
  @mail.mobile = mobile
383
383
  @mail.from = '<えーゆー> au@ezweb.ne.jp'
384
384
 
385
- @mail.encoded.should match(/content-transfer-encoding: base64/i)
386
- @mail.encoded.should match(data)
385
+ expect(@mail.encoded).to match(/content-transfer-encoding: base64/i)
386
+ expect(@mail.encoded).to match(data)
387
387
  end
388
388
  end
389
389
  end
@@ -5,30 +5,30 @@ describe Jpmobile::Mobile::Iphone do
5
5
  describe 'iOS 4.0' do
6
6
  it "unicode_emoticon? should be false" do
7
7
  request = double('request')
8
- request.stub(:user_agent) {'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_4 like Mac OS X; ja-jp) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8K2 Safari/6533.18.5'}
8
+ allow(request).to receive(:user_agent) {'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_4 like Mac OS X; ja-jp) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8K2 Safari/6533.18.5'}
9
9
 
10
10
  mobile = Jpmobile::Mobile::Iphone.new({}, request)
11
- mobile.unicode_emoticon?.should be_falsey
11
+ expect(mobile.unicode_emoticon?).to be_falsey
12
12
  end
13
13
  end
14
14
 
15
15
  describe 'iOS 5.0' do
16
16
  it "unicode_emoticon? should be true" do
17
17
  request = double('request')
18
- request.stub(:user_agent) {'Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B206 Safari/7534.48.3'}
18
+ allow(request).to receive(:user_agent) {'Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B206 Safari/7534.48.3'}
19
19
 
20
20
  mobile = Jpmobile::Mobile::Iphone.new({}, request)
21
- mobile.unicode_emoticon?.should be_truthy
21
+ expect(mobile.unicode_emoticon?).to be_truthy
22
22
  end
23
23
  end
24
24
 
25
25
  describe 'iOS 6.0' do
26
26
  it "unicode_emoticon? should be true" do
27
27
  request = double('request')
28
- request.stub(:user_agent) {'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A403 Safari/8536.25'}
28
+ allow(request).to receive(:user_agent) {'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A403 Safari/8536.25'}
29
29
 
30
30
  mobile = Jpmobile::Mobile::Iphone.new({}, request)
31
- mobile.unicode_emoticon?.should be_truthy
31
+ expect(mobile.unicode_emoticon?).to be_truthy
32
32
  end
33
33
  end
34
34
  end