tdiary 4.0.2.20140201 → 4.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +4 -0
  3. data/ChangeLog +3 -0
  4. data/Gemfile +5 -5
  5. data/Gemfile.lock +48 -29
  6. data/README.md +1 -1
  7. data/Rakefile +1 -1
  8. data/index.rb +2 -2
  9. data/js/01conf.js +16 -0
  10. data/misc/convert2.rb +3 -3
  11. data/misc/filter/limitdays.rb +2 -2
  12. data/misc/filter/linkcheck.rb +2 -2
  13. data/misc/lib/fcgi_patch.rb +3 -3
  14. data/misc/paas/cloudfoundry/Gemfile.lock +51 -48
  15. data/misc/paas/heroku/Gemfile.lock +23 -21
  16. data/misc/paas/sqale/Gemfile.lock +23 -21
  17. data/misc/plugin/a.rb +4 -4
  18. data/misc/plugin/calendar2.rb +1 -1
  19. data/misc/plugin/category.rb +3 -3
  20. data/misc/plugin/comment_emoji_autocomplete.rb +1 -1
  21. data/misc/plugin/comment_mail-qmail.rb +1 -1
  22. data/misc/plugin/comment_mail-sendmail.rb +1 -1
  23. data/misc/plugin/comment_mail-smtp.rb +1 -1
  24. data/misc/plugin/counter.rb +27 -27
  25. data/misc/plugin/disp_referrer.rb +1 -1
  26. data/misc/plugin/en/amazon.rb +2 -2
  27. data/misc/plugin/en/category.rb +1 -1
  28. data/misc/plugin/en/counter.rb +1 -1
  29. data/misc/plugin/en/disp_referrer.rb +1 -1
  30. data/misc/plugin/en/kw.rb +1 -1
  31. data/misc/plugin/en/search_form.rb +1 -1
  32. data/misc/plugin/en/todo.rb +1 -1
  33. data/misc/plugin/en/weather.rb +5 -2
  34. data/misc/plugin/image.rb +2 -2
  35. data/misc/plugin/ja/disp_referrer.rb +7 -7
  36. data/misc/plugin/ja/my-sequel.rb +1 -1
  37. data/misc/plugin/ja/recent_comment3.rb +1 -1
  38. data/misc/plugin/ja/referer_scheme.rb +1 -1
  39. data/misc/plugin/ja/search_control.rb +1 -1
  40. data/misc/plugin/ja/search_form.rb +2 -2
  41. data/misc/plugin/ja/todo.rb +1 -1
  42. data/misc/plugin/ja/weather.rb +17 -12
  43. data/misc/plugin/makelirs.rb +4 -4
  44. data/misc/plugin/my-ex.rb +1 -1
  45. data/misc/plugin/my-sequel.rb +1 -1
  46. data/misc/plugin/pb-show.rb +1 -1
  47. data/misc/plugin/recent_comment.rb +5 -5
  48. data/misc/plugin/recent_comment3.rb +2 -2
  49. data/misc/plugin/recent_namazu.rb +4 -4
  50. data/misc/plugin/recent_rss.rb +7 -7
  51. data/misc/plugin/referer_scheme.rb +2 -2
  52. data/misc/plugin/search-default.rb +1 -1
  53. data/misc/plugin/sn.rb +3 -3
  54. data/misc/plugin/speed_comment.rb +1 -1
  55. data/misc/plugin/squeeze.rb +8 -8
  56. data/misc/plugin/tb-show.rb +1 -1
  57. data/misc/plugin/theme_online.rb +25 -0
  58. data/misc/plugin/tlink.rb +2 -2
  59. data/misc/plugin/todo.rb +2 -2
  60. data/misc/plugin/weather.rb +82 -26
  61. data/misc/plugin/whatsnew.rb +1 -1
  62. data/misc/plugin/xmlrpc/xmlrpc.rb +11 -11
  63. data/misc/theme_convert/theme_convert.rb +3 -3
  64. data/plugin/00default.rb +35 -28
  65. data/plugin/50sp.rb +1 -1
  66. data/plugin/60sf.rb +1 -1
  67. data/plugin/90migrate.rb +2 -2
  68. data/plugin/en/00default.rb +1 -1
  69. data/plugin/ja/00default.rb +1 -1
  70. data/spec/acceptance/append_comment_spec.rb +18 -18
  71. data/spec/acceptance/append_diary_spec.rb +22 -22
  72. data/spec/acceptance/bugfix/encoding_error_spec.rb +1 -1
  73. data/spec/acceptance/save_conf_comment_spec.rb +15 -15
  74. data/spec/acceptance/save_conf_default_spec.rb +26 -26
  75. data/spec/acceptance/save_conf_dnsbl_spec.rb +19 -19
  76. data/spec/acceptance/save_conf_filter_spec.rb +6 -6
  77. data/spec/acceptance/save_conf_plugin_spec.rb +11 -11
  78. data/spec/acceptance/save_conf_referer_spec.rb +4 -4
  79. data/spec/acceptance/save_conf_security_spec.rb +28 -28
  80. data/spec/acceptance/update_diary_spec.rb +16 -16
  81. data/spec/acceptance/view_category_spec.rb +1 -1
  82. data/spec/acceptance/view_comment_spec.rb +6 -6
  83. data/spec/acceptance/view_diary_spec.rb +25 -25
  84. data/spec/acceptance/view_referer_spec.rb +3 -3
  85. data/spec/core/compatible_spec.rb +5 -5
  86. data/spec/core/configuration_spec.rb +3 -3
  87. data/spec/core/core_ext_spec.rb +7 -7
  88. data/spec/core/io/default_spec.rb +1 -1
  89. data/spec/core/plugin_spec.rb +41 -41
  90. data/spec/core/rack/assets/precompile_spec.rb +3 -3
  91. data/spec/core/rack/html_anchor_spec.rb +15 -15
  92. data/spec/core/rack/static_spec.rb +3 -3
  93. data/spec/core/rack/valid_request_path_spec.rb +13 -13
  94. data/spec/core/style/tdiary_style_spec.rb +10 -10
  95. data/spec/core/style/wiki_style_spec.rb +16 -16
  96. data/spec/plugin/bq_spec.rb +2 -2
  97. data/spec/spec_helper.rb +3 -1
  98. data/tdiary/configuration.rb +2 -2
  99. data/tdiary/environment.rb +1 -1
  100. data/tdiary/io/default.rb +1 -1
  101. data/tdiary/lang/ja.rb +2 -2
  102. data/tdiary/tasks/db.rake +5 -5
  103. data/tdiary/version.rb +1 -1
  104. data/test/disp_referrer_test.rb +4 -4
  105. data/test/my-sequel_test.rb +1 -1
  106. data/test/test_plugin_helper.rb +47 -0
  107. data/test/weather-ADDS-METARS-PHTO-140131.html +109 -0
  108. data/test/weather-ADDS-METARS-RJAA-130131.html +111 -0
  109. data/test/weather-ADDS-METARS-RJAA-130227.html +111 -0
  110. data/test/weather_test.rb +144 -18
  111. data/update.rb +2 -2
  112. metadata +10 -3
@@ -16,13 +16,13 @@ describe TDiary::Plugin do
16
16
  subject { @plugin }
17
17
 
18
18
  it '読み込まれたプラグインのメソッドを呼び出せること' do
19
- subject.sample.should eq 'sample plugin'
19
+ expect(subject.sample).to eq 'sample plugin'
20
20
  end
21
21
 
22
22
  it 'プラグイン一覧が @plugin_files で取得できること' do
23
23
  # TODO: 実際にはPlugin.newした時点でload_pluginが呼ばれている
24
24
  # @plugin_filesの追加もinitializeメソッド内で実行されている
25
- subject.instance_variable_get(:@plugin_files).should include('spec/fixtures/plugin/sample.rb')
25
+ expect(subject.instance_variable_get(:@plugin_files)).to include('spec/fixtures/plugin/sample.rb')
26
26
  end
27
27
 
28
28
  context 'リソースファイルが存在する場合' do
@@ -32,7 +32,7 @@ describe TDiary::Plugin do
32
32
  end
33
33
 
34
34
  it 'Confファイルで指定した言語に対応するリソースが読み込まれること' do
35
- @plugin.sample_ja.should eq 'サンプルプラグイン'
35
+ expect(@plugin.sample_ja).to eq 'サンプルプラグイン'
36
36
  end
37
37
  end
38
38
  end
@@ -45,12 +45,12 @@ describe TDiary::Plugin do
45
45
  subject { @plugin.eval_src(@src, false) }
46
46
 
47
47
  it 'Pluginオブジェクト内でソースが実行されること' do
48
- should eq 'hello sample plugin'
48
+ is_expected.to eq 'hello sample plugin'
49
49
  end
50
50
 
51
51
  context 'secureモード指定の場合' do
52
52
  it 'Safeモード4で実行されること' do
53
- Safe.should_receive(:safe).with(4)
53
+ expect(Safe).to receive(:safe).with(4)
54
54
  @plugin.eval_src(@src, true)
55
55
  end
56
56
  end
@@ -72,7 +72,7 @@ describe TDiary::Plugin do
72
72
  subject { @plugin.__send__(:header_proc) }
73
73
 
74
74
  it 'add_header_procで登録したブロックが実行されること' do
75
- should eq 'header1 header2'
75
+ is_expected.to eq 'header1 header2'
76
76
  end
77
77
  end
78
78
 
@@ -84,7 +84,7 @@ describe TDiary::Plugin do
84
84
  subject { @plugin.__send__(:footer_proc) }
85
85
 
86
86
  it 'add_footer_procで登録したブロックが実行されること' do
87
- should eq 'footer1 footer2'
87
+ is_expected.to eq 'footer1 footer2'
88
88
  end
89
89
  end
90
90
 
@@ -98,14 +98,14 @@ describe TDiary::Plugin do
98
98
  subject { @plugin.__send__(:update_proc) }
99
99
 
100
100
  it 'add_update_procで登録したブロックが実行されること' do
101
- proc1.should_receive(:call)
102
- proc2.should_receive(:call)
101
+ expect(proc1).to receive(:call)
102
+ expect(proc2).to receive(:call)
103
103
  # should_receiveの場合はsubjectが使えないため明示的に実行
104
104
  @plugin.__send__(:update_proc)
105
105
  end
106
106
 
107
107
  it '空の文字列を返すこと' do
108
- should eq ''
108
+ is_expected.to eq ''
109
109
  end
110
110
  end
111
111
 
@@ -120,17 +120,17 @@ describe TDiary::Plugin do
120
120
  subject { @plugin.__send__(:title_proc, date, 'title') }
121
121
 
122
122
  it 'add_title_procで登録したブロックを実行し、最後の結果を返すこと' do
123
- should eq 'title2'
123
+ is_expected.to eq 'title2'
124
124
  end
125
125
 
126
126
  it '前のprocの結果が次のprocに渡されること' do
127
- proc1.should_receive(:call).with(date, 'title').and_return('title1')
128
- proc2.should_receive(:call).with(date, 'title1')
127
+ expect(proc1).to receive(:call).with(date, 'title').and_return('title1')
128
+ expect(proc2).to receive(:call).with(date, 'title1')
129
129
  @plugin.__send__(:title_proc, date, 'title')
130
130
  end
131
131
 
132
132
  it 'apply_pluginメソッドを呼び出すこと' do
133
- @plugin.should_receive(:apply_plugin)
133
+ expect(@plugin).to receive(:apply_plugin)
134
134
  # should_receiveの場合はsubjectが使えないため明示的に実行
135
135
  @plugin.__send__(:title_proc, date, 'title')
136
136
  end
@@ -145,7 +145,7 @@ describe TDiary::Plugin do
145
145
  subject { @plugin.__send__(:body_enter_proc, date) }
146
146
 
147
147
  it 'add_body_enter_procで登録したブロックが実行されること' do
148
- should eq 'body1 body2'
148
+ is_expected.to eq 'body1 body2'
149
149
  end
150
150
  end
151
151
 
@@ -157,7 +157,7 @@ describe TDiary::Plugin do
157
157
  subject { @plugin.__send__(:body_leave_proc, @date) }
158
158
 
159
159
  it 'add_body_leave_procで登録したブロックが実行されること' do
160
- should eq 'body1 body2'
160
+ is_expected.to eq 'body1 body2'
161
161
  end
162
162
  end
163
163
 
@@ -173,15 +173,15 @@ describe TDiary::Plugin do
173
173
  subject { @plugin.__send__(:section_enter_proc, date1) }
174
174
 
175
175
  it 'add_section_enter_procで登録したブロックを実行し、結果を連結して返すこと' do
176
- should eq 'section1 section2'
176
+ is_expected.to eq 'section1 section2'
177
177
  end
178
178
 
179
179
  it '呼ばれた回数に応じてセクション番号の数が増加すること (日付単位)' do
180
- proc1.should_receive(:call).with(date1, 1)
180
+ expect(proc1).to receive(:call).with(date1, 1)
181
181
  @plugin.__send__(:section_enter_proc, date1)
182
- proc1.should_receive(:call).with(date1, 2)
182
+ expect(proc1).to receive(:call).with(date1, 2)
183
183
  @plugin.__send__(:section_enter_proc, date1)
184
- proc1.should_receive(:call).with(date2, 1)
184
+ expect(proc1).to receive(:call).with(date2, 1)
185
185
  @plugin.__send__(:section_enter_proc, date2)
186
186
  end
187
187
  end
@@ -198,18 +198,18 @@ describe TDiary::Plugin do
198
198
  subject { @plugin.__send__(:subtitle_proc, date1, 'subtitle') }
199
199
 
200
200
  it 'add_subtitle_procで登録したブロックを実行し、最後の結果を返すこと' do
201
- should eq 'subtitle2'
201
+ is_expected.to eq 'subtitle2'
202
202
  end
203
203
 
204
204
  it '前のprocの結果が次のprocに渡されること' do
205
- proc1.should_receive(:call).with(date1, 1, 'subtitle').and_return('subtitle1')
206
- proc2.should_receive(:call).with(date1, 1, 'subtitle1')
205
+ expect(proc1).to receive(:call).with(date1, 1, 'subtitle').and_return('subtitle1')
206
+ expect(proc2).to receive(:call).with(date1, 1, 'subtitle1')
207
207
  @plugin.__send__(:section_enter_proc, date1)
208
208
  @plugin.__send__(:subtitle_proc, date1, 'subtitle')
209
209
  end
210
210
 
211
211
  it 'apply_pluginメソッドを呼び出すこと' do
212
- @plugin.should_receive(:apply_plugin)
212
+ expect(@plugin).to receive(:apply_plugin)
213
213
  # should_receiveの場合はsubjectが使えないため明示的に実行
214
214
  @plugin.__send__(:subtitle_proc, date1, 'title')
215
215
  end
@@ -227,18 +227,18 @@ describe TDiary::Plugin do
227
227
  subject { @plugin.__send__(:section_leave_proc, date1) }
228
228
 
229
229
  it 'add_section_leave_procで登録したブロックを実行し、結果を連結して返すこと' do
230
- should eq 'section1 section2'
230
+ is_expected.to eq 'section1 section2'
231
231
  end
232
232
 
233
233
  it '呼ばれた回数に応じてセクション番号の数が増加すること (日付単位)' do
234
234
  # セクション番号はsection_enter_procの呼び出し回数で決定する
235
- proc1.should_receive(:call).with(date1, 1)
235
+ expect(proc1).to receive(:call).with(date1, 1)
236
236
  @plugin.__send__(:section_enter_proc, date1)
237
237
  @plugin.__send__(:section_leave_proc, date1)
238
- proc1.should_receive(:call).with(date1, 2)
238
+ expect(proc1).to receive(:call).with(date1, 2)
239
239
  @plugin.__send__(:section_enter_proc, date1)
240
240
  @plugin.__send__(:section_leave_proc, date1)
241
- proc1.should_receive(:call).with(date2, 1)
241
+ expect(proc1).to receive(:call).with(date2, 1)
242
242
  @plugin.__send__(:section_enter_proc, date2)
243
243
  @plugin.__send__(:section_leave_proc, date2)
244
244
  end
@@ -253,7 +253,7 @@ describe TDiary::Plugin do
253
253
  subject { @plugin.__send__(:comment_leave_proc, date) }
254
254
 
255
255
  it 'add_comment_leave_procで登録したブロックが実行されること' do
256
- should eq 'comment1 comment2'
256
+ is_expected.to eq 'comment1 comment2'
257
257
  end
258
258
  end
259
259
 
@@ -266,7 +266,7 @@ describe TDiary::Plugin do
266
266
  subject { @plugin.__send__(:edit_proc, date) }
267
267
 
268
268
  it 'add_edit_procで登録したブロックが実行されること' do
269
- should eq 'edit1 edit2'
269
+ is_expected.to eq 'edit1 edit2'
270
270
  end
271
271
  end
272
272
 
@@ -279,7 +279,7 @@ describe TDiary::Plugin do
279
279
  subject { @plugin.__send__(:form_proc, date) }
280
280
 
281
281
  it 'add_form_procで登録したブロックが実行されること' do
282
- should eq 'form1 form2'
282
+ is_expected.to eq 'form1 form2'
283
283
  end
284
284
  end
285
285
 
@@ -290,21 +290,21 @@ describe TDiary::Plugin do
290
290
  context '@modeがconfの場合' do
291
291
  before { @plugin.instance_variable_set(:@mode, 'conf') }
292
292
  it 'コールバックを登録すること' do
293
- should include('label1')
293
+ is_expected.to include('label1')
294
294
  end
295
295
  end
296
296
 
297
297
  context '@modeがsaveconfの場合' do
298
298
  before { @plugin.instance_variable_set(:@mode, 'saveconf') }
299
299
  it 'コールバックを登録すること' do
300
- should include('label1')
300
+ is_expected.to include('label1')
301
301
  end
302
302
  end
303
303
 
304
304
  context '@modeがconf, saveconf以外の場合' do
305
305
  before { @plugin.instance_variable_set(:@mode, 'edit') }
306
306
  it 'コールバックの登録を無視すること' do
307
- should be_nil
307
+ is_expected.to be_nil
308
308
  end
309
309
  end
310
310
  end
@@ -319,7 +319,7 @@ describe TDiary::Plugin do
319
319
  subject { @plugin.__send__(:conf_proc, 'key1') }
320
320
 
321
321
  it 'add_conf_procで登録したブロックのうち、keyが一致するものを実行して結果を返すこと' do
322
- should eq 'conf1'
322
+ is_expected.to eq 'conf1'
323
323
  end
324
324
  end
325
325
 
@@ -328,7 +328,7 @@ describe TDiary::Plugin do
328
328
  subject { @plugin.__send__(:remove_tag, @string) }
329
329
 
330
330
  it '文字列からタグが除去されること' do
331
- should eq 'test example.com'
331
+ is_expected.to eq 'test example.com'
332
332
  end
333
333
  end
334
334
 
@@ -339,22 +339,22 @@ describe TDiary::Plugin do
339
339
 
340
340
  subject { @plugin.__send__(:apply_plugin, '<%= sample %>') }
341
341
  it 'プラグインが再実行されること' do
342
- should eq 'sample plugin'
342
+ is_expected.to eq 'sample plugin'
343
343
  end
344
344
 
345
345
  context '解釈できない文字列を渡された場合' do
346
346
  subject { @plugin.__send__(:apply_plugin, '<%= undefined_method %>') }
347
- it { should include 'Invalid Text' }
347
+ it { is_expected.to include 'Invalid Text' }
348
348
  end
349
349
 
350
350
  context '文字列がnilの場合' do
351
351
  subject { @plugin.__send__(:apply_plugin, nil) }
352
- it { should eq '' }
352
+ it { is_expected.to eq '' }
353
353
  end
354
354
 
355
355
  context 'remove_tagがtrueの場合' do
356
356
  it 'remove_tagメソッドを呼び出すこと' do
357
- @plugin.should_receive(:remove_tag)
357
+ expect(@plugin).to receive(:remove_tag)
358
358
  @plugin.__send__(:apply_plugin, '', true)
359
359
  end
360
360
  end
@@ -371,7 +371,7 @@ describe TDiary::Plugin do
371
371
  subject { @plugin.__send__(:content_proc, 'key1', date) }
372
372
 
373
373
  it 'add_content_procで登録したブロックのうち、keyに相当するものを実行すること' do
374
- should eq 'contents1'
374
+ is_expected.to eq 'contents1'
375
375
  end
376
376
 
377
377
  context 'keyに相当するブロックが存在しない場合' do
@@ -30,7 +30,7 @@ describe TDiary::Rack::Assets::Precompile do
30
30
  end
31
31
 
32
32
  it "JavaScript にコンパイルされる" do
33
- FileTest.exist?("#{assets_path}/foo.js").should be_true
33
+ expect(FileTest.exist?("#{assets_path}/foo.js")).to be_truthy
34
34
  end
35
35
  end
36
36
 
@@ -46,7 +46,7 @@ describe TDiary::Rack::Assets::Precompile do
46
46
  end
47
47
 
48
48
  it "JavaScript が更新される" do
49
- @jstime.should < File.mtime("#{assets_path}/foo.js").to_i
49
+ expect(@jstime).to be < File.mtime("#{assets_path}/foo.js").to_i
50
50
  end
51
51
  end
52
52
 
@@ -61,7 +61,7 @@ describe TDiary::Rack::Assets::Precompile do
61
61
  end
62
62
 
63
63
  it "JavaScript は更新されない" do
64
- @jstime.should == File.mtime("#{assets_path}/foo.js").to_i
64
+ expect(@jstime).to eq(File.mtime("#{assets_path}/foo.js").to_i)
65
65
  end
66
66
  end
67
67
  end
@@ -11,47 +11,47 @@ describe TDiary::Rack::HtmlAnchor do
11
11
 
12
12
  it 'should not do anything for root access' do
13
13
  get '/'
14
- last_request.params['date'].should == nil
15
- last_request.query_string.should == ''
14
+ expect(last_request.params['date']).to eq(nil)
15
+ expect(last_request.query_string).to eq('')
16
16
  end
17
17
 
18
18
  it 'should remove the file name from PATH_INFO' do
19
19
  get '/20120501.html'
20
- last_request.env['PATH_INFO'].should == '/'
20
+ expect(last_request.env['PATH_INFO']).to eq('/')
21
21
  get '/diary/20120501.html'
22
- last_request.env['PATH_INFO'].should == '/diary/'
22
+ expect(last_request.env['PATH_INFO']).to eq('/diary/')
23
23
  end
24
24
 
25
25
  it 'should add date query' do
26
26
  get '/diary/0501.html'
27
- last_request.params['date'].should == "0501"
27
+ expect(last_request.params['date']).to eq("0501")
28
28
  get '/0501.html'
29
- last_request.params['date'].should == "0501"
29
+ expect(last_request.params['date']).to eq("0501")
30
30
  get '/201205.html'
31
- last_request.params['date'].should == "201205"
31
+ expect(last_request.params['date']).to eq("201205")
32
32
  get '/20120501.html'
33
- last_request.params['date'].should == "20120501"
33
+ expect(last_request.params['date']).to eq("20120501")
34
34
  end
35
35
 
36
36
  it 'should add date query when using section_permalink_anchor plugin' do
37
37
  get '/20120501p01.html'
38
- last_request.params['date'].should == "20120501"
39
- last_request.params['p'].should == "01"
38
+ expect(last_request.params['date']).to eq("20120501")
39
+ expect(last_request.params['p']).to eq("01")
40
40
  end
41
41
 
42
42
  it 'should replace date query' do
43
43
  get '/20120501.html?date=20120101'
44
- last_request.params['date'].should == "20120501"
44
+ expect(last_request.params['date']).to eq("20120501")
45
45
  end
46
46
 
47
47
  it 'should not break original query' do
48
48
  get '/?date=20120501'
49
- last_request.params['date'].should == "20120501"
49
+ expect(last_request.params['date']).to eq("20120501")
50
50
  get '/index.rb?date=20120501'
51
- last_request.params['date'].should == "20120501"
51
+ expect(last_request.params['date']).to eq("20120501")
52
52
  get '/index.rb?date=20120501&p=01'
53
- last_request.params['date'].should == "20120501"
54
- last_request.params['p'].should == "01"
53
+ expect(last_request.params['date']).to eq("20120501")
54
+ expect(last_request.params['p']).to eq("01")
55
55
  end
56
56
  end
57
57
  end
@@ -11,17 +11,17 @@ describe TDiary::Rack::Static do
11
11
 
12
12
  it 'should return the file in static directory' do
13
13
  get '/README.md'
14
- last_response.should be_ok
14
+ expect(last_response).to be_ok
15
15
  end
16
16
 
17
17
  it 'should run the app if file is not exist' do
18
18
  get '/index.rb'
19
- last_response.status.should be 500
19
+ expect(last_response.status).to be 500
20
20
  end
21
21
 
22
22
  it 'should run the app when post method' do
23
23
  post '/index.rb'
24
- last_response.status.should be 500
24
+ expect(last_response.status).to be 500
25
25
  end
26
26
  end
27
27
  end
@@ -11,57 +11,57 @@ describe TDiary::Rack::ValidRequestPath do
11
11
 
12
12
  it 'should return 200 for latest' do
13
13
  get '/'
14
- last_response.should be_ok
14
+ expect(last_response).to be_ok
15
15
  end
16
16
 
17
17
  it 'should return 200 for a nyear' do
18
18
  get '/0501.html'
19
- last_response.should be_ok
19
+ expect(last_response).to be_ok
20
20
  end
21
21
 
22
22
  it 'should return 200 for a month' do
23
23
  get '/201205.html'
24
- last_response.should be_ok
24
+ expect(last_response).to be_ok
25
25
  end
26
26
 
27
27
  it 'should return 200 for a day' do
28
28
  get '/20120501.html'
29
- last_response.should be_ok
29
+ expect(last_response).to be_ok
30
30
  end
31
31
 
32
32
  it 'should return 200 for a day with section_permalink_anchor plugin' do
33
33
  get '/20120501p01.html'
34
- last_response.should be_ok
34
+ expect(last_response).to be_ok
35
35
  end
36
36
 
37
37
  it 'should return 200 for a day with query' do
38
38
  get '/?date=20120501'
39
- last_response.should be_ok
39
+ expect(last_response).to be_ok
40
40
  end
41
41
 
42
42
  it 'should return 200 for a day with query and section_permalink_anchor plugin' do
43
43
  get '/?date=20120501&p=01'
44
- last_response.should be_ok
44
+ expect(last_response).to be_ok
45
45
  end
46
46
 
47
47
  it 'should return 200 for a day with index.rb and query' do
48
48
  get '/index.rb?date=20120501'
49
- last_response.should be_ok
49
+ expect(last_response).to be_ok
50
50
  end
51
51
 
52
52
  it 'should return 404 for access to the invalid file' do
53
53
  get '/20120501'
54
- last_response.status.should be 404
54
+ expect(last_response.status).to be 404
55
55
  get '/invalid'
56
- last_response.status.should be 404
56
+ expect(last_response.status).to be 404
57
57
  head '/invalid'
58
- last_response.status.should be 404
59
- last_response.body.length.should be 0
58
+ expect(last_response.status).to be 404
59
+ expect(last_response.body.length).to be 0
60
60
  end
61
61
 
62
62
  it 'should return 404 for access to the invalid directory' do
63
63
  get '/invalid/'
64
- last_response.status.should == 404
64
+ expect(last_response.status).to eq(404)
65
65
  end
66
66
  end
67
67
  end
@@ -42,7 +42,7 @@ subTitle2
42
42
  </div>
43
43
  EOF
44
44
  end
45
- it { @diary.to_html.should eq @html.chomp }
45
+ it { expect(@diary.to_html).to eq @html.chomp }
46
46
  end
47
47
 
48
48
  context 'CHTML' do
@@ -56,12 +56,12 @@ subTitle2
56
56
  <p>honbun</p><%= section_leave_proc( Time::at( 1041346800 ) ) %>
57
57
  EOF
58
58
  end
59
- it { @diary.to_html({}, :CHTML).should eq @html }
59
+ it { expect(@diary.to_html({}, :CHTML)).to eq @html }
60
60
  end
61
61
 
62
62
 
63
63
  context 'to_src' do
64
- it { @diary.to_src.should eq @source }
64
+ it { expect(@diary.to_src).to eq @source }
65
65
  end
66
66
  end
67
67
 
@@ -98,7 +98,7 @@ replaceTitle2
98
98
  </div>
99
99
  EOF
100
100
  end
101
- it { @diary.to_html.should eq @html.chomp }
101
+ it { expect(@diary.to_html).to eq @html.chomp }
102
102
  end
103
103
 
104
104
  describe '#add_section' do
@@ -122,7 +122,7 @@ subTitle
122
122
  </div>
123
123
  EOF
124
124
  end
125
- it { @diary.to_html.should eq @html.chomp }
125
+ it { expect(@diary.to_html).to eq @html.chomp }
126
126
  end
127
127
 
128
128
  describe '#delete_section' do
@@ -145,7 +145,7 @@ subTitle2
145
145
  </div>
146
146
  EOF
147
147
  end
148
- it { @diary.to_html.should eq @html.chomp }
148
+ it { expect(@diary.to_html).to eq @html.chomp }
149
149
  end
150
150
 
151
151
  describe 'test_tdiary_style2' do
@@ -167,7 +167,7 @@ subTitle2
167
167
  </div>
168
168
  EOF
169
169
  end
170
- it { @diary.to_html.should eq @html.chomp }
170
+ it { expect(@diary.to_html).to eq @html.chomp }
171
171
  end
172
172
 
173
173
  context 'CHTML' do
@@ -178,7 +178,7 @@ subTitle2
178
178
  <p>honbun</p><%= section_leave_proc( Time::at( 1041346800 ) ) %>
179
179
  EOF
180
180
  end
181
- it { @diary.to_html({}, :CHTML).should eq @html }
181
+ it { expect(@diary.to_html({}, :CHTML)).to eq @html }
182
182
  end
183
183
  end
184
184
 
@@ -215,7 +215,7 @@ ge%><%= section_leave_proc( Time::at( 1041346800 ) ) %>
215
215
  </div>
216
216
  EOF
217
217
  end
218
- it { @diary.to_html.should eq @html.chomp }
218
+ it { expect(@diary.to_html).to eq @html.chomp }
219
219
  end
220
220
 
221
221
  context 'CHTML' do
@@ -233,7 +233,7 @@ ge%>b
233
233
  ge%><%= section_leave_proc( Time::at( 1041346800 ) ) %>
234
234
  EOF
235
235
  end
236
- it { @diary.to_html({}, :CHTML).should eq @html }
236
+ it { expect(@diary.to_html({}, :CHTML)).to eq @html }
237
237
  end
238
238
  end
239
239
  end