Package: ruby-clockwork / 1.2.0-3

fix_test_with_minitest.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
Description: Remove test unit dependency and refactor tests for Minitest
Author: Ari Summer <aribsummer@gmail.com>
Forwarded: https://github.com/tomykaira/clockwork/pull/174
Last-Update: 2016-03-03

--- a/clockwork.gemspec
+++ b/clockwork.gemspec
@@ -23,7 +23,6 @@ Gem::Specification.new do |s|
   s.add_development_dependency "bundler", "~> 1.3"
   s.add_development_dependency "rake"
   s.add_development_dependency "daemons"
-  s.add_development_dependency "test-unit"
-  s.add_development_dependency "minitest", "~> 4.0"
+  s.add_development_dependency "minitest", "~> 5.8"
   s.add_development_dependency "mocha"
 end
diff --git a/gemfiles/activesupport4.gemfile b/gemfiles/activesupport4.gemfile
index 1885c88..56c54c8 100644
--- a/gemfiles/activesupport4.gemfile
+++ b/gemfiles/activesupport4.gemfile
@@ -7,4 +7,5 @@ platforms :rbx do
 end
 
 gem 'activesupport', '~> 4.0.0'
+gem 'minitest', '~> 4.2'
 gemspec :path=>"../"
diff --git a/test/at_test.rb b/test/at_test.rb
index d5fdbba..c2a281b 100644
--- a/test/at_test.rb
+++ b/test/at_test.rb
@@ -1,31 +1,30 @@
 require File.expand_path('../../lib/clockwork', __FILE__)
 require 'rubygems'
-require 'test/unit'
 require 'mocha/setup'
 require 'time'
 require 'active_support/time'
-require 'active_support/test_case'
+require "minitest/autorun"
 
-class AtTest < ActiveSupport::TestCase
+describe 'Clockwork::At' do
   def time_in_day(hour, minute)
     Time.new(2013, 1, 1, hour, minute, 0)
   end
 
-  test '16:20' do
+  it '16:20' do
     at = Clockwork::At.parse('16:20')
     assert !at.ready?(time_in_day(16, 19))
     assert  at.ready?(time_in_day(16, 20))
     assert !at.ready?(time_in_day(16, 21))
   end
 
-  test '8:20' do
+  it '8:20' do
     at = Clockwork::At.parse('8:20')
     assert !at.ready?(time_in_day(8, 19))
     assert  at.ready?(time_in_day(8, 20))
     assert !at.ready?(time_in_day(8, 21))
   end
 
-  test '**:20 with two stars' do
+  it '**:20 with two stars' do
     at = Clockwork::At.parse('**:20')
 
     assert !at.ready?(time_in_day(15, 19))
@@ -37,7 +36,7 @@ def time_in_day(hour, minute)
     assert !at.ready?(time_in_day(16, 21))
   end
 
-  test '*:20 with one star' do
+  it '*:20 with one star' do
     at = Clockwork::At.parse('*:20')
 
     assert !at.ready?(time_in_day(15, 19))
@@ -49,7 +48,7 @@ def time_in_day(hour, minute)
     assert !at.ready?(time_in_day(16, 21))
   end
 
-  test '16:**' do
+  it '16:**' do
     at = Clockwork::At.parse('16:**')
 
     assert !at.ready?(time_in_day(15, 59))
@@ -59,7 +58,7 @@ def time_in_day(hour, minute)
     assert !at.ready?(time_in_day(17, 00))
   end
 
-  test '8:**' do
+  it '8:**' do
     at = Clockwork::At.parse('8:**')
 
     assert !at.ready?(time_in_day(7, 59))
@@ -69,7 +68,7 @@ def time_in_day(hour, minute)
     assert !at.ready?(time_in_day(9, 00))
   end
 
-  test 'Saturday 12:00' do
+  it 'Saturday 12:00' do
     at = Clockwork::At.parse('Saturday 12:00')
 
     assert !at.ready?(Time.new(2010, 1, 1, 12, 00))
@@ -78,7 +77,7 @@ def time_in_day(hour, minute)
     assert  at.ready?(Time.new(2010, 1, 9, 12, 00))
   end
 
-  test 'sat 12:00' do
+  it 'sat 12:00' do
     at = Clockwork::At.parse('sat 12:00')
 
     assert !at.ready?(Time.new(2010, 1, 1, 12, 00))
@@ -86,34 +85,33 @@ def time_in_day(hour, minute)
     assert !at.ready?(Time.new(2010, 1, 3, 12, 00))
   end
 
-  test 'invalid time 32:00' do
-    assert_raise Clockwork::At::FailedToParse do
+  it 'invalid time 32:00' do
+    assert_raises Clockwork::At::FailedToParse do
       Clockwork::At.parse('32:00')
     end
   end
 
-  test 'invalid multi-line with Sat 12:00' do
-    assert_raise Clockwork::At::FailedToParse do
+  it 'invalid multi-line with Sat 12:00' do
+    assert_raises Clockwork::At::FailedToParse do
       Clockwork::At.parse("sat 12:00\nreally invalid time")
     end
   end
 
-  test 'invalid multi-line with 8:30' do
-    assert_raise Clockwork::At::FailedToParse do
+  it 'invalid multi-line with 8:30' do
+    assert_raises Clockwork::At::FailedToParse do
       Clockwork::At.parse("8:30\nreally invalid time")
     end
   end
 
-  test 'invalid multi-line with *:10' do
-    assert_raise Clockwork::At::FailedToParse do
+  it 'invalid multi-line with *:10' do
+    assert_raises Clockwork::At::FailedToParse do
       Clockwork::At.parse("*:10\nreally invalid time")
     end
   end
 
-  test 'invalid multi-line with 12:**' do
-    assert_raise Clockwork::At::FailedToParse do
+  it 'invalid multi-line with 12:**' do
+    assert_raises Clockwork::At::FailedToParse do
       Clockwork::At.parse("12:**\nreally invalid time")
     end
   end
-
 end
diff --git a/test/clockwork_test.rb b/test/clockwork_test.rb
index a02f797..c03c948 100644
--- a/test/clockwork_test.rb
+++ b/test/clockwork_test.rb
@@ -1,9 +1,9 @@
 require File.expand_path('../../lib/clockwork', __FILE__)
-require 'test/unit'
+require 'minitest/autorun'
 require 'mocha/setup'
 
-class ClockworkTest < Test::Unit::TestCase
-  setup do
+describe Clockwork do
+  before do
     @log_output = StringIO.new
     Clockwork.configure do |config|
       config[:sleep_timeout] = 0
@@ -11,11 +11,11 @@ class ClockworkTest < Test::Unit::TestCase
     end
   end
 
-  teardown do
+  after do
     Clockwork.clear!
   end
 
-  test 'should run events with configured logger' do
+  it 'should run events with configured logger' do
     run = false
     Clockwork.handler do |job|
       run = job == 'myjob'
@@ -23,11 +23,12 @@ class ClockworkTest < Test::Unit::TestCase
     Clockwork.every(1.minute, 'myjob')
     Clockwork.manager.expects(:loop).yields.then.returns
     Clockwork.run
+
     assert run
     assert @log_output.string.include?('Triggering')
   end
 
-  test 'should log event correctly' do
+  it 'should log event correctly' do
     run = false
     Clockwork.handler do |job|
       run = job == 'an event'
@@ -39,7 +40,7 @@ class ClockworkTest < Test::Unit::TestCase
     assert @log_output.string.include?("Triggering 'an event'")
   end
 
-  test 'should pass event without modification to handler' do
+  it 'should pass event without modification to handler' do
     event_object = Object.new
     run = false
     Clockwork.handler do |job|
@@ -51,7 +52,7 @@ class ClockworkTest < Test::Unit::TestCase
     assert run
   end
 
-  test 'should not run anything after reset' do
+  it 'should not run anything after reset' do
     Clockwork.every(1.minute, 'myjob') {  }
     Clockwork.clear!
     Clockwork.configure do |config|
@@ -63,7 +64,7 @@ class ClockworkTest < Test::Unit::TestCase
     assert @log_output.string.include?('0 events')
   end
 
-  test 'should pass all arguments to every' do
+  it 'should pass all arguments to every' do
     Clockwork.every(1.second, 'myjob', if: lambda { |_| false }) {  }
     Clockwork.manager.expects(:loop).yields.then.returns
     Clockwork.run
@@ -71,7 +72,7 @@ class ClockworkTest < Test::Unit::TestCase
     assert !@log_output.string.include?('Triggering')
   end
 
-  test 'support module re-open style' do
+  it 'support module re-open style' do
     $called = false
     module ::Clockwork
       every(1.second, 'myjob') { $called = true }
diff --git a/test/database_events/sync_performer_test.rb b/test/database_events/sync_performer_test.rb
index b229d19..ee33e55 100644
--- a/test/database_events/sync_performer_test.rb
+++ b/test/database_events/sync_performer_test.rb
@@ -1,297 +1,290 @@
-require 'test/unit'
+require "minitest/autorun"
 require 'mocha/setup'
 require 'time'
 require 'active_support/time'
-require 'active_support/test_case'
 
 require_relative '../../lib/clockwork'
 require_relative '../../lib/clockwork/database_events'
 require_relative 'test_helpers'
 
-module DatabaseEvents
+describe Clockwork::DatabaseEvents::SyncPerformer do
+  before do
+    @now = Time.now
+    DatabaseEventModel.delete_all
+    DatabaseEventModel2.delete_all
 
-  class SyncPerformerTest < ActiveSupport::TestCase
-
-    setup do
-      @now = Time.now
-      DatabaseEventModel.delete_all
-      DatabaseEventModel2.delete_all
-
-      Clockwork.manager = @manager = Clockwork::DatabaseEvents::Manager.new
-      class << @manager
-        def log(msg); end # silence log output
-      end
+    Clockwork.manager = @manager = Clockwork::DatabaseEvents::Manager.new
+    class << @manager
+      def log(msg); end # silence log output
     end
+  end
 
-    describe "setup" do
-      setup do
-        @subject = Clockwork::DatabaseEvents::SyncPerformer
-      end
+  after do
+    Clockwork.clear!
+  end
 
-      describe "arguments" do
-        def test_does_not_raise_error_with_valid_arguments
-          @subject.setup(model: DatabaseEventModel, every: 1.minute) {}
-        end
+  describe "setup" do
+    before do
+      @subject = Clockwork::DatabaseEvents::SyncPerformer
+    end
 
-        def test_raises_argument_error_if_model_is_not_set
-          error = assert_raises KeyError do
-            @subject.setup(every: 1.minute) {}
-          end
-          assert_equal error.message, ":model must be set to the model class"
+    describe "arguments" do
+      it 'raises argument error if model is not set' do
+        error = assert_raises KeyError do
+          @subject.setup(every: 1.minute) {}
         end
+        assert_equal error.message, ":model must be set to the model class"
+      end
 
-        def test_raises_argument_error_if_every_is_not_set
-          error = assert_raises KeyError do
-            @subject.setup(model: DatabaseEventModel) {}
-          end
-          assert_equal error.message, ":every must be set to the database sync frequency"
+      it 'raises argument error if every is not set' do
+        error = assert_raises KeyError do
+          @subject.setup(model: DatabaseEventModel) {}
         end
+        assert_equal error.message, ":every must be set to the database sync frequency"
       end
+    end
 
-      context "when database reload frequency is greater than model frequency period" do
-        setup do
-          @events_run = []
-          @sync_frequency = 1.minute
-        end
+    describe "when database reload frequency is greater than model frequency period" do
+      before do
+        @events_run = []
+        @sync_frequency = 1.minute
+      end
 
-        def test_fetches_and_registers_event_from_database
-          DatabaseEventModel.create(:frequency => 10)
-          setup_sync(model: DatabaseEventModel, :every => @sync_frequency, :events_run => @events_run)
+      it 'fetches and registers event from database' do
+        DatabaseEventModel.create(:frequency => 10)
+        setup_sync(model: DatabaseEventModel, :every => @sync_frequency, :events_run => @events_run)
 
-          tick_at(@now, :and_every_second_for => 1.second)
+        tick_at(@now, :and_every_second_for => 1.second)
 
-          assert_equal ["DatabaseEventModel:1"], @events_run
-        end
+        assert_equal ["DatabaseEventModel:1"], @events_run
+      end
 
-        def test_multiple_events_from_database_can_be_registered
-          DatabaseEventModel.create(:frequency => 10)
-          DatabaseEventModel.create(:frequency => 10)
-          setup_sync(model: DatabaseEventModel, :every => @sync_frequency, :events_run => @events_run)
+      it 'fetches and registers multiple events from database' do
+        DatabaseEventModel.create(:frequency => 10)
+        DatabaseEventModel.create(:frequency => 10)
+        setup_sync(model: DatabaseEventModel, :every => @sync_frequency, :events_run => @events_run)
 
-          tick_at(@now, :and_every_second_for => 1.second)
+        tick_at(@now, :and_every_second_for => 1.second)
 
-          assert_equal ["DatabaseEventModel:1", "DatabaseEventModel:2"], @events_run
-        end
+        assert_equal ["DatabaseEventModel:1", "DatabaseEventModel:2"], @events_run
+      end
 
-        def test_event_from_database_does_not_run_again_before_frequency_specified_in_database
-          model = DatabaseEventModel.create(:frequency => 10)
-          setup_sync(model: DatabaseEventModel, :every => @sync_frequency, :events_run => @events_run)
+      it 'does not run event again before frequency specified in database' do
+        model = DatabaseEventModel.create(:frequency => 10)
+        setup_sync(model: DatabaseEventModel, :every => @sync_frequency, :events_run => @events_run)
 
-          tick_at(@now, :and_every_second_for => model.frequency - 1.second)
-          assert_equal 1, @events_run.length
-        end
+        tick_at(@now, :and_every_second_for => model.frequency - 1.second)
+        assert_equal 1, @events_run.length
+      end
 
-        def test_event_from_database_runs_repeatedly_with_frequency_specified_in_database
-          model = DatabaseEventModel.create(:frequency => 10)
-          setup_sync(model: DatabaseEventModel, :every => @sync_frequency, :events_run => @events_run)
+      it 'runs event repeatedly with frequency specified in database' do
+        model = DatabaseEventModel.create(:frequency => 10)
+        setup_sync(model: DatabaseEventModel, :every => @sync_frequency, :events_run => @events_run)
 
-          tick_at(@now, :and_every_second_for => (2 * model.frequency) + 1.second)
+        tick_at(@now, :and_every_second_for => (2 * model.frequency) + 1.second)
 
-          assert_equal 3, @events_run.length
-        end
+        assert_equal 3, @events_run.length
+      end
 
-        def test_reloaded_events_from_database_run_repeatedly
-          model = DatabaseEventModel.create(:frequency => 10)
-          setup_sync(model: DatabaseEventModel, :every => @sync_frequency, :events_run => @events_run)
+      it 'runs reloaded events from database repeatedly' do
+        model = DatabaseEventModel.create(:frequency => 10)
+        setup_sync(model: DatabaseEventModel, :every => @sync_frequency, :events_run => @events_run)
 
-          tick_at(@now, :and_every_second_for => @sync_frequency - 1)
-          model.update(:name => "DatabaseEventModel:1:Reloaded")
-          tick_at(@now + @sync_frequency, :and_every_second_for => model.frequency * 2)
+        tick_at(@now, :and_every_second_for => @sync_frequency - 1)
+        model.update(:name => "DatabaseEventModel:1:Reloaded")
+        tick_at(@now + @sync_frequency, :and_every_second_for => model.frequency * 2)
 
-          assert_equal ["DatabaseEventModel:1:Reloaded", "DatabaseEventModel:1:Reloaded"], @events_run[-2..-1]
-        end
+        assert_equal ["DatabaseEventModel:1:Reloaded", "DatabaseEventModel:1:Reloaded"], @events_run[-2..-1]
+      end
 
-        def test_reloading_events_from_database_with_modified_frequency_will_run_with_new_frequency
-          model = DatabaseEventModel.create(:frequency => 10)
-          setup_sync(model: DatabaseEventModel, :every => @sync_frequency, :events_run => @events_run)
+      it 'updates modified event frequency with event reloading' do
+        model = DatabaseEventModel.create(:frequency => 10)
+        setup_sync(model: DatabaseEventModel, :every => @sync_frequency, :events_run => @events_run)
 
-          tick_at(@now, :and_every_second_for => @sync_frequency - 1.second)
-          model.update(:frequency => 5)
-          tick_at(@now + @sync_frequency, :and_every_second_for => 6.seconds)
+        tick_at(@now, :and_every_second_for => @sync_frequency - 1.second)
+        model.update(:frequency => 5)
+        tick_at(@now + @sync_frequency, :and_every_second_for => 6.seconds)
 
-          # model runs at: 1, 11, 21, 31, 41, 51 (6 runs)
-          # database sync happens at: 60
-          # modified model runs at: 61 (next tick after reload) and then 66 (2 runs)
-          assert_equal 8, @events_run.length
-        end
+        # model runs at: 1, 11, 21, 31, 41, 51 (6 runs)
+        # database sync happens at: 60
+        # modified model runs at: 61 (next tick after reload) and then 66 (2 runs)
+        assert_equal 8, @events_run.length
+      end
 
-        def test_stops_running_deleted_events_from_database
-          model = DatabaseEventModel.create(:frequency => 10)
-          setup_sync(model: DatabaseEventModel, :every => @sync_frequency, :events_run => @events_run)
+      it 'stoped running deleted events from database' do
+        model = DatabaseEventModel.create(:frequency => 10)
+        setup_sync(model: DatabaseEventModel, :every => @sync_frequency, :events_run => @events_run)
 
-          tick_at(@now, :and_every_second_for => (@sync_frequency - 1.second))
-          before = @events_run.dup
-          model.delete!
-          tick_at(@now + @sync_frequency, :and_every_second_for => @sync_frequency)
-          after = @events_run
+        tick_at(@now, :and_every_second_for => (@sync_frequency - 1.second))
+        before = @events_run.dup
+        model.delete!
+        tick_at(@now + @sync_frequency, :and_every_second_for => @sync_frequency)
+        after = @events_run
 
-          assert_equal before, after
-        end
+        assert_equal before, after
+      end
 
-        def test_event_from_database_with_edited_name_switches_to_new_name
-          model = DatabaseEventModel.create(:frequency => 10.seconds)
-          setup_sync(model: DatabaseEventModel, :every => @sync_frequency, :events_run => @events_run)
+      it 'updates event name with new name' do
+        model = DatabaseEventModel.create(:frequency => 10.seconds)
+        setup_sync(model: DatabaseEventModel, :every => @sync_frequency, :events_run => @events_run)
 
-          tick_at @now, :and_every_second_for => @sync_frequency - 1.second
-          @events_run.clear
-          model.update(:name => "DatabaseEventModel:1_modified")
-          tick_at @now + @sync_frequency, :and_every_second_for => (model.frequency * 2)
+        tick_at @now, :and_every_second_for => @sync_frequency - 1.second
+        @events_run.clear
+        model.update(:name => "DatabaseEventModel:1_modified")
+        tick_at @now + @sync_frequency, :and_every_second_for => (model.frequency * 2)
 
-          assert_equal ["DatabaseEventModel:1_modified", "DatabaseEventModel:1_modified"], @events_run
-        end
+        assert_equal ["DatabaseEventModel:1_modified", "DatabaseEventModel:1_modified"], @events_run
+      end
 
-        def test_event_from_database_with_edited_frequency_switches_to_new_frequency
-          model = DatabaseEventModel.create(:frequency => 10)
-          setup_sync(model: DatabaseEventModel, :every => @sync_frequency, :events_run => @events_run)
+      it 'updates event frequency with new frequency' do
+        model = DatabaseEventModel.create(:frequency => 10)
+        setup_sync(model: DatabaseEventModel, :every => @sync_frequency, :events_run => @events_run)
 
-          tick_at @now, :and_every_second_for => @sync_frequency - 1.second
-          @events_run.clear
-          model.update(:frequency => 30)
-          tick_at @now + @sync_frequency, :and_every_second_for => @sync_frequency - 1.seconds
+        tick_at @now, :and_every_second_for => @sync_frequency - 1.second
+        @events_run.clear
+        model.update(:frequency => 30)
+        tick_at @now + @sync_frequency, :and_every_second_for => @sync_frequency - 1.seconds
 
-          assert_equal 2, @events_run.length
-        end
+        assert_equal 2, @events_run.length
+      end
 
-        def test_event_from_database_with_edited_at_runs_at_new_at
-          model = DatabaseEventModel.create(:frequency => 1.day, :at => '10:30')
-          setup_sync(model: DatabaseEventModel, :every => @sync_frequency, :events_run => @events_run)
+      it 'updates event at with new at' do
+        model = DatabaseEventModel.create(:frequency => 1.day, :at => '10:30')
+        setup_sync(model: DatabaseEventModel, :every => @sync_frequency, :events_run => @events_run)
 
-          assert_will_run 'jan 1 2010 10:30:00'
-          assert_wont_run 'jan 1 2010 09:30:00'
+        assert_will_run 'jan 1 2010 10:30:00'
+        assert_wont_run 'jan 1 2010 09:30:00'
 
-          model.update(:at => '09:30')
-          tick_at @now, :and_every_second_for => @sync_frequency + 1.second
+        model.update(:at => '09:30')
+        tick_at @now, :and_every_second_for => @sync_frequency + 1.second
 
-          assert_will_run 'jan 1 2010 09:30:00'
-          assert_wont_run 'jan 1 2010 10:30:00'
-        end
+        assert_will_run 'jan 1 2010 09:30:00'
+        assert_wont_run 'jan 1 2010 10:30:00'
+      end
 
-        context "when #name is defined" do
-          def test_daily_event_from_database_with_at_should_only_run_once
-            DatabaseEventModel.create(:frequency => 1.day, :at => next_minute(@now).strftime('%H:%M'))
-            setup_sync(model: DatabaseEventModel, :every => @sync_frequency, :events_run => @events_run)
+      describe "when #name is defined" do
+        it 'runs daily event with at from databse only once' do
+          DatabaseEventModel.create(:frequency => 1.day, :at => next_minute(@now).strftime('%H:%M'))
+          setup_sync(model: DatabaseEventModel, :every => @sync_frequency, :events_run => @events_run)
 
-            # tick from now, though specified :at time
-            tick_at(@now, :and_every_second_for => (2 * @sync_frequency) + 1.second)
+          # tick from now, though specified :at time
+          tick_at(@now, :and_every_second_for => (2 * @sync_frequency) + 1.second)
 
-            assert_equal 1, @events_run.length
-          end
+          assert_equal 1, @events_run.length
         end
+      end
 
-        context "when #name is not defined" do
-
-          def test_daily_event_from_database_with_at_should_only_run_once
-            DatabaseEventModelWithoutName.create(:frequency => 1.day, :at => next_minute(next_minute(@now)).strftime('%H:%M'))
-            setup_sync(model: DatabaseEventModelWithoutName, :every => @sync_frequency, :events_run => @events_run)
-
-            # tick from now, though specified :at time
-            tick_at(@now, :and_every_second_for => (2 * @sync_frequency) + 1.second)
+      describe "when #name is not defined" do
+        it 'runs daily event with at from databse only once' do
+          DatabaseEventModelWithoutName.create(:frequency => 1.day, :at => next_minute(next_minute(@now)).strftime('%H:%M'))
+          setup_sync(model: DatabaseEventModelWithoutName, :every => @sync_frequency, :events_run => @events_run)
 
-            assert_equal 1, @events_run.length
-          end
+          # tick from now, though specified :at time
+          tick_at(@now, :and_every_second_for => (2 * @sync_frequency) + 1.second)
 
+          assert_equal 1, @events_run.length
         end
+      end
 
-        def test_event_from_database_with_comma_separated_at_leads_to_multiple_event_ats
-          DatabaseEventModel.create(:frequency => 1.day, :at => '16:20, 18:10')
-          setup_sync(model: DatabaseEventModel, :every => @sync_frequency, :events_run => @events_run)
+      it 'creates multiple event ats with comma separated at string' do
+        DatabaseEventModel.create(:frequency => 1.day, :at => '16:20, 18:10')
+        setup_sync(model: DatabaseEventModel, :every => @sync_frequency, :events_run => @events_run)
 
-          tick_at @now, :and_every_second_for => 1.second
+        tick_at @now, :and_every_second_for => 1.second
 
-          assert_wont_run 'jan 1 2010 16:19:59'
-          assert_will_run 'jan 1 2010 16:20:00'
-          assert_wont_run 'jan 1 2010 16:20:01'
+        assert_wont_run 'jan 1 2010 16:19:59'
+        assert_will_run 'jan 1 2010 16:20:00'
+        assert_wont_run 'jan 1 2010 16:20:01'
 
-          assert_wont_run 'jan 1 2010 18:09:59'
-          assert_will_run 'jan 1 2010 18:10:00'
-          assert_wont_run 'jan 1 2010 18:10:01'
-        end
+        assert_wont_run 'jan 1 2010 18:09:59'
+        assert_will_run 'jan 1 2010 18:10:00'
+        assert_wont_run 'jan 1 2010 18:10:01'
+      end
 
-        def test_syncing_multiple_database_models_works
-          DatabaseEventModel.create(:frequency => 10)
-          setup_sync(model: DatabaseEventModel, :every => @sync_frequency, :events_run => @events_run)
+      it 'allows syncing multiple database models' do
+        DatabaseEventModel.create(:frequency => 10)
+        setup_sync(model: DatabaseEventModel, :every => @sync_frequency, :events_run => @events_run)
 
-          DatabaseEventModel2.create(:frequency => 10)
-          setup_sync(model: DatabaseEventModel2, :every => @sync_frequency, :events_run => @events_run)
+        DatabaseEventModel2.create(:frequency => 10)
+        setup_sync(model: DatabaseEventModel2, :every => @sync_frequency, :events_run => @events_run)
 
-          tick_at(@now, :and_every_second_for => 1.second)
+        tick_at(@now, :and_every_second_for => 1.second)
 
-          assert_equal ["DatabaseEventModel:1", "DatabaseEventModel2:1"], @events_run
-        end
+        assert_equal ["DatabaseEventModel:1", "DatabaseEventModel2:1"], @events_run
       end
+    end
 
-      context "when database reload frequency is less than model frequency period" do
-        setup do
-          @events_run = []
-        end
+    describe "when database reload frequency is less than model frequency period" do
+      before do
+        @events_run = []
+      end
 
-        def test_the_event_only_runs_once_within_the_model_frequency_period
-          DatabaseEventModel.create(:frequency => 5.minutes)
-          setup_sync(model: DatabaseEventModel, :every => 1.minute, :events_run => @events_run)
+      it 'runs event only once within the model frequency period' do
+        DatabaseEventModel.create(:frequency => 5.minutes)
+        setup_sync(model: DatabaseEventModel, :every => 1.minute, :events_run => @events_run)
 
-          tick_at(@now, :and_every_second_for => 5.minutes)
+        tick_at(@now, :and_every_second_for => 5.minutes)
 
-          assert_equal 1, @events_run.length
-        end
+        assert_equal 1, @events_run.length
       end
+    end
 
-      context "with database event with :at as empty string" do
-        setup do
-          @events_run = []
+    describe "with database event :at set to empty string" do
+      before do
+        @events_run = []
 
-          DatabaseEventModel.create(:frequency => 10)
-          setup_sync(model: DatabaseEventModel, :every => 1.minute, :events_run => @events_run)
-        end
+        DatabaseEventModel.create(:frequency => 10)
+        setup_sync(model: DatabaseEventModel, :every => 1.minute, :events_run => @events_run)
+      end
 
-        def test_it_does_not_raise_an_error
-          begin
-            tick_at(Time.now, :and_every_second_for => 10.seconds)
-          rescue => e
-            assert false, "Raised an error: #{e.message}"
-          end
+      it 'does not raise an error' do
+        begin
+          tick_at(Time.now, :and_every_second_for => 10.seconds)
+        rescue => e
+          assert false, "Raised an error: #{e.message}"
         end
+      end
 
-        def test_the_event_runs
-          begin
-            tick_at(Time.now, :and_every_second_for => 10.seconds)
-          rescue => e
-          end
-          assert_equal 1, @events_run.length
+      it 'runs the event' do
+        begin
+          tick_at(Time.now, :and_every_second_for => 10.seconds)
+        rescue
         end
+        assert_equal 1, @events_run.length
       end
+    end
 
-      context "with task that respond to `tz`" do
-        setup do
-          @events_run = []
-          @utc_time_now = Time.now.utc
+    describe "with task that responds to `tz`" do
+      before do
+        @events_run = []
+        @utc_time_now = Time.now.utc
 
-          DatabaseEventModel.create(:frequency => 1.days, :at => @utc_time_now.strftime('%H:%M'), :tz => 'America/Montreal')
-          setup_sync(model: DatabaseEventModel, :every => 1.minute, :events_run => @events_run)
-        end
+        DatabaseEventModel.create(:frequency => 1.days, :at => @utc_time_now.strftime('%H:%M'), :tz => 'America/Montreal')
+        setup_sync(model: DatabaseEventModel, :every => 1.minute, :events_run => @events_run)
+      end
 
-        def test_it_does_not_raise_an_error
-          begin
-            tick_at(@utc_time_now, :and_every_second_for => 10.seconds)
-          rescue => e
-            assert false, "Raised an error: #{e.message}"
-          end
+      it 'does not raise an error' do
+        begin
+          tick_at(@utc_time_now, :and_every_second_for => 10.seconds)
+        rescue => e
+          assert false, "Raised an error: #{e.message}"
         end
+      end
 
-        def test_it_do_not_runs_the_task_as_utc
-          begin
-            tick_at(@utc_time_now, :and_every_second_for => 3.hours)
-          rescue => e
-          end
-          assert_equal 0, @events_run.length
+      it 'does not run the event based on UTC' do
+        begin
+          tick_at(@utc_time_now, :and_every_second_for => 3.hours)
+        rescue
         end
+        assert_equal 0, @events_run.length
+      end
 
-        def test_it_does_runs_the_task_as_est
-          begin
-            tick_at(@utc_time_now, :and_every_second_for => 5.hours)
-          rescue => e
-          end
-          assert_equal 1, @events_run.length
+      it 'runs the event based on America/Montreal tz' do
+        begin
+          tick_at(@utc_time_now, :and_every_second_for => 5.hours)
+        rescue
         end
+        assert_equal 1, @events_run.length
       end
     end
   end
diff --git a/test/event_test.rb b/test/event_test.rb
index 9f3e21a..566a426 100644
--- a/test/event_test.rb
+++ b/test/event_test.rb
@@ -1,34 +1,34 @@
 require File.expand_path('../../lib/clockwork', __FILE__)
-require 'active_support/test_case'
+require "minitest/autorun"
 
-class EventTest < ActiveSupport::TestCase
-  describe "#thread?" do
-    setup do
-      @manager = mock
+describe Clockwork::Event do
+  describe '#thread?' do
+    before do
+      @manager = Class.new
     end
 
-    describe "manager config thread option set to true" do
-      setup do
+    describe 'manager config thread option set to true' do
+      before do
         @manager.stubs(:config).returns({ :thread => true })
       end
 
-      test "is true" do
+      it 'is true' do
         event = Clockwork::Event.new(@manager, nil, nil, nil)
         assert_equal true, event.thread?
       end
 
-      test "is false when event thread option set" do
+      it 'is false when event thread option set' do
         event = Clockwork::Event.new(@manager, nil, nil, nil, :thread => false)
         assert_equal false, event.thread?
       end
     end
 
-    describe "manager config thread option not set" do
-      setup do
+    describe 'manager config thread option not set' do
+      before do
         @manager.stubs(:config).returns({})
       end
 
-      test "is true if event thread option is true" do
+      it 'is true if event thread option is true' do
         event = Clockwork::Event.new(@manager, nil, nil, nil, :thread => true)
         assert_equal true, event.thread?
       end
diff --git a/test/manager_test.rb b/test/manager_test.rb
index 795e43f..a02401b 100644
--- a/test/manager_test.rb
+++ b/test/manager_test.rb
@@ -1,13 +1,12 @@
 require File.expand_path('../../lib/clockwork', __FILE__)
 require 'rubygems'
-require 'test/unit'
 require 'mocha/setup'
 require 'time'
 require 'active_support/time'
-require 'active_support/test_case'
+require "minitest/autorun"
 
-class ManagerTest < ActiveSupport::TestCase
-  setup do
+describe Clockwork::Manager do
+  before do
     @manager = Clockwork::Manager.new
     class << @manager
       def log(msg); end
@@ -29,7 +28,7 @@ def assert_wont_run(t)
     assert_equal 0, @manager.tick(t).size
   end
 
-  test "once a minute" do
+  it "once a minute" do
     @manager.every(1.minute, 'myjob')
 
     assert_will_run(t=Time.now)
@@ -37,7 +36,7 @@ def assert_wont_run(t)
     assert_will_run(t+60)
   end
 
-  test "every three minutes" do
+  it "every three minutes" do
     @manager.every(3.minutes, 'myjob')
 
     assert_will_run(t=Time.now)
@@ -45,7 +44,7 @@ def assert_wont_run(t)
     assert_will_run(t+3*60)
   end
 
-  test "once an hour" do
+  it "once an hour" do
     @manager.every(1.hour, 'myjob')
 
     assert_will_run(t=Time.now)
@@ -53,7 +52,7 @@ def assert_wont_run(t)
     assert_will_run(t+60*60)
   end
 
-  test "once a week" do
+  it "once a week" do
     @manager.every(1.week, 'myjob')
 
     assert_will_run(t=Time.now)
@@ -61,7 +60,7 @@ def assert_wont_run(t)
     assert_will_run(t+60*60*24*7)
   end
 
-  test "won't drift later and later" do
+  it "won't drift later and later" do
     @manager.every(1.hour, 'myjob')
 
     assert_will_run(Time.parse("10:00:00.5"))
@@ -69,20 +68,20 @@ def assert_wont_run(t)
     assert_will_run(Time.parse("11:00:00.0"))
   end
 
-  test "aborts when no handler defined" do
+  it "aborts when no handler defined" do
     manager = Clockwork::Manager.new
-    assert_raise(Clockwork::Manager::NoHandlerDefined) do
+    assert_raises(Clockwork::Manager::NoHandlerDefined) do
       manager.every(1.minute, 'myjob')
     end
   end
 
-  test "aborts when fails to parse" do
-    assert_raise(Clockwork::At::FailedToParse) do
+  it "aborts when fails to parse" do
+    assert_raises(Clockwork::At::FailedToParse) do
       @manager.every(1.day, "myjob", :at => "a:bc")
     end
   end
 
-  test "general handler" do
+  it "general handler" do
     $set_me = 0
     @manager.handler { $set_me = 1 }
     @manager.every(1.minute, 'myjob')
@@ -90,7 +89,7 @@ def assert_wont_run(t)
     assert_equal 1, $set_me
   end
 
-  test "event-specific handler" do
+  it "event-specific handler" do
     $set_me = 0
     @manager.every(1.minute, 'myjob') { $set_me = 2 }
     @manager.tick(Time.now)
@@ -98,7 +97,7 @@ def assert_wont_run(t)
     assert_equal 2, $set_me
   end
 
-  test "should pass time to the general handler" do
+  it "should pass time to the general handler" do
     received = nil
     now = Time.now
     @manager.handler { |job, time| received = time }
@@ -107,7 +106,7 @@ def assert_wont_run(t)
     assert_equal now, received
   end
 
-  test "should pass time to the event-specific handler" do
+  it "should pass time to the event-specific handler" do
     received = nil
     now = Time.now
     @manager.every(1.minute, 'myjob') { |job, time| received = time }
@@ -115,20 +114,18 @@ def assert_wont_run(t)
     assert_equal now, received
   end
 
-  test "exceptions are trapped and logged" do
+  it "exceptions are trapped and logged" do
     @manager.handler { raise 'boom' }
     @manager.every(1.minute, 'myjob')
 
-    logger = Logger.new(StringIO.new)
-    @manager.configure { |c| c[:logger] = logger }
-    logger.expects(:error)
-
-    assert_nothing_raised do
-      @manager.tick(Time.now)
-    end
+    mocked_logger = MiniTest::Mock.new
+    mocked_logger.expect :error, true, [RuntimeError]
+    @manager.configure { |c| c[:logger] = mocked_logger }
+    @manager.tick(Time.now)
+    mocked_logger.verify
   end
 
-  test "exceptions still set the last timestamp to avoid spastic error loops" do
+  it "exceptions still set the last timestamp to avoid spastic error loops" do
     @manager.handler { raise 'boom' }
     event = @manager.every(1.minute, 'myjob')
     @manager.stubs(:log_error)
@@ -136,7 +133,7 @@ def assert_wont_run(t)
     assert_equal t, event.last
   end
 
-  test "should be configurable" do
+  it "should be configurable" do
     @manager.configure do |config|
       config[:sleep_timeout] = 200
       config[:logger] = "A Logger"
@@ -150,25 +147,25 @@ def assert_wont_run(t)
     assert_equal true, @manager.config[:thread]
   end
 
-  test "configuration should have reasonable defaults" do
+  it "configuration should have reasonable defaults" do
     assert_equal 1, @manager.config[:sleep_timeout]
     assert @manager.config[:logger].is_a?(Logger)
     assert_equal 10, @manager.config[:max_threads]
     assert_equal false, @manager.config[:thread]
   end
 
-  test "should accept unnamed job" do
+  it "should accept unnamed job" do
     event = @manager.every(1.minute)
     assert_equal 'unnamed', event.job
   end
 
-  test "should accept options without job name" do
+  it "should accept options without job name" do
     event = @manager.every(1.minute, {})
     assert_equal 'unnamed', event.job
   end
 
   describe ':at option' do
-    test "once a day at 16:20" do
+    it "once a day at 16:20" do
       @manager.every(1.day, 'myjob', :at => '16:20')
 
       assert_wont_run 'jan 1 2010 16:19:59'
@@ -178,7 +175,7 @@ def assert_wont_run(t)
       assert_will_run 'jan 2 2010 16:20:00'
     end
 
-    test "twice a day at 16:20 and 18:10" do
+    it "twice a day at 16:20 and 18:10" do
       @manager.every(1.day, 'myjob', :at => ['16:20', '18:10'])
 
       assert_wont_run 'jan 1 2010 16:19:59'
@@ -192,18 +189,18 @@ def assert_wont_run(t)
   end
 
   describe ':tz option' do
-    test "time zone is not set by default" do
+    it "time zone is not set by default" do
       assert @manager.config[:tz].nil?
     end
 
-    test "should be able to specify a different timezone than local" do
+    it "should be able to specify a different timezone than local" do
       @manager.every(1.day, 'myjob', :at => '10:00', :tz => 'UTC')
 
       assert_wont_run 'jan 1 2010 10:00:00 EST'
       assert_will_run 'jan 1 2010 10:00:00 UTC'
     end
 
-    test "should be able to specify a different timezone than local for multiple times" do
+    it "should be able to specify a different timezone than local for multiple times" do
       @manager.every(1.day, 'myjob', :at => ['10:00', '8:00'], :tz => 'UTC')
 
       assert_wont_run 'jan 1 2010 08:00:00 EST'
@@ -212,7 +209,7 @@ def assert_wont_run(t)
       assert_will_run 'jan 1 2010 10:00:00 UTC'
     end
 
-    test "should be able to configure a default timezone to use for all events" do
+    it "should be able to configure a default timezone to use for all events" do
       @manager.configure { |config| config[:tz] = 'UTC' }
       @manager.every(1.day, 'myjob', :at => '10:00')
 
@@ -220,7 +217,7 @@ def assert_wont_run(t)
       assert_will_run 'jan 1 2010 10:00:00 UTC'
     end
 
-    test "should be able to override a default timezone in an event" do
+    it "should be able to override a default timezone in an event" do
       @manager.configure { |config| config[:tz] = 'UTC' }
       @manager.every(1.day, 'myjob', :at => '10:00', :tz => 'EST')
 
@@ -230,19 +227,19 @@ def assert_wont_run(t)
   end
 
   describe ':if option' do
-    test ":if true then always run" do
+    it ":if true then always run" do
       @manager.every(1.second, 'myjob', :if => lambda { |_| true })
 
       assert_will_run 'jan 1 2010 16:20:00'
     end
 
-    test ":if false then never run" do
+    it ":if false then never run" do
       @manager.every(1.second, 'myjob', :if => lambda { |_| false })
 
       assert_wont_run 'jan 1 2010 16:20:00'
     end
 
-    test ":if the first day of month" do
+    it ":if the first day of month" do
       @manager.every(1.second, 'myjob', :if => lambda { |t| t.day == 1 })
 
       assert_will_run 'jan 1 2010 16:20:00'
@@ -250,7 +247,7 @@ def assert_wont_run(t)
       assert_will_run 'feb 1 2010 16:20:00'
     end
 
-    test ":if it is compared to a time with zone" do
+    it ":if it is compared to a time with zone" do
       tz = 'America/Chicago'
       time = Time.utc(2012,5,25,10,00)
       @manager.every(1.second, 'myjob', tz: tz, :if => lambda  { |t|
@@ -259,15 +256,15 @@ def assert_wont_run(t)
       assert_will_run time
     end
 
-    test ":if is not callable then raise ArgumentError" do
-      assert_raise(ArgumentError) do
+    it ":if is not callable then raise ArgumentError" do
+      assert_raises(ArgumentError) do
         @manager.every(1.second, 'myjob', :if => true)
       end
     end
   end
 
   describe "max_threads" do
-    test "should warn when an event tries to generate threads more than max_threads" do
+    it "should warn when an event tries to generate threads more than max_threads" do
       logger = Logger.new(STDOUT)
       @manager.configure do |config|
         config[:max_threads] = 1
@@ -281,7 +278,7 @@ def assert_wont_run(t)
       @manager.tick(Time.now)
     end
 
-    test "should not warn when thread is managed by others" do
+    it "should not warn when thread is managed by others" do
       begin
         t = Thread.new { sleep 5 }
         logger = Logger.new(StringIO.new)
@@ -301,15 +298,15 @@ def assert_wont_run(t)
   end
 
   describe "callbacks" do
-    test "should not accept unknown callback name" do
-      assert_raise(RuntimeError, "Unsupported callback unknown_callback") do
+    it "should not accept unknown callback name" do
+      assert_raises(RuntimeError, "Unsupported callback unknown_callback") do
         @manager.on(:unknown_callback) do
           true
         end
       end
     end
 
-    test "should run before_tick callback once on tick" do
+    it "should run before_tick callback once on tick" do
       counter = 0
       @manager.on(:before_tick) do
         counter += 1
@@ -318,7 +315,7 @@ def assert_wont_run(t)
       assert_equal 1, counter
     end
 
-    test "should not run events if before_tick returns false" do
+    it "should not run events if before_tick returns false" do
       @manager.on(:before_tick) do
         false
       end
@@ -326,7 +323,7 @@ def assert_wont_run(t)
       @manager.tick
     end
 
-    test "should run before_run twice if two events are registered" do
+    it "should run before_run twice if two events are registered" do
       counter = 0
       @manager.on(:before_run) do
         counter += 1
@@ -337,7 +334,7 @@ def assert_wont_run(t)
       assert_equal 2, counter
     end
 
-    test "should run even jobs only" do
+    it "should run even jobs only" do
       counter = 0
       ran = false
       @manager.on(:before_run) do
@@ -350,7 +347,7 @@ def assert_wont_run(t)
       assert ran
     end
 
-    test "should run after_run callback for each event" do
+    it "should run after_run callback for each event" do
       counter = 0
       @manager.on(:after_run) do
         counter += 1
@@ -361,7 +358,7 @@ def assert_wont_run(t)
       assert_equal 2, counter
     end
 
-    test "should run after_tick callback once" do
+    it "should run after_tick callback once" do
       counter = 0
       @manager.on(:after_tick) do
         counter += 1
@@ -372,7 +369,7 @@ def assert_wont_run(t)
   end
 
   describe 'error_handler' do
-    setup do
+    before do
       @errors = []
       @manager.error_handler do |e|
         @errors << e
@@ -383,24 +380,24 @@ def assert_wont_run(t)
       @manager.configure do |config|
         config[:logger] = Logger.new(@string_io)
       end
-      @manager.every(1.second, 'myjob') { raise 'test error' }
+      @manager.every(1.second, 'myjob') { raise 'it error' }
     end
 
-    test 'registered error_handler handles error from event' do
+    it 'registered error_handler handles error from event' do
       @manager.tick
-      assert_equal ['test error'], @errors.map(&:message)
+      assert_equal ['it error'], @errors.map(&:message)
     end
 
-    test 'error is notified to logger and handler' do
+    it 'error is notified to logger and handler' do
       @manager.tick
-      assert @string_io.string.include?('test error')
+      assert @string_io.string.include?('it error')
     end
 
-    test 'error in handler will NOT be suppressed' do
+    it 'error in handler will NOT be suppressed' do
       @manager.error_handler do |e|
         raise e.message + ' re-raised'
       end
-      assert_raise(RuntimeError, 'test error re-raised') do
+      assert_raises(RuntimeError, 'it error re-raised') do
         @manager.tick
       end
     end