File tree Expand file tree Collapse file tree 1 file changed +24
-6
lines changed Expand file tree Collapse file tree 1 file changed +24
-6
lines changed Original file line number Diff line number Diff line change 10
10
11
11
test 'it schedules' do
12
12
13
- File . open ( 'test/qrontab' , 'wb' ) do |f |
13
+ File . open ( 'test/qrontab' , 'wb' ) { |f |
14
14
f . write ( %{
15
15
* * * * * * $seen = true
16
- } )
17
- end
16
+ } ) }
18
17
19
18
$seen = false
20
19
33
32
34
33
test 'it schedules @reboot' do
35
34
36
- File . open ( 'test/qrontab' , 'wb' ) do |f |
35
+ File . open ( 'test/qrontab' , 'wb' ) { |f |
37
36
f . write ( %{
38
37
@reboot $booted = true
39
- } )
40
- end
38
+ } ) }
41
39
42
40
$booted = false
43
41
53
51
54
52
assert q . started , nil
55
53
end
54
+
55
+ test 'it schedules with a timezone' do
56
+
57
+ File . open ( 'test/qrontab' , 'wb' ) { |f |
58
+ f . write ( %{
59
+ * * * * * $a << 'five'
60
+ * * * * * * $a << 'six'
61
+ * * * * * Asia/Tokyo $a << ctx[:cron].timezone.name
62
+ * * * * * * Europe/Budapest $a << ctx[:cron].timezone.name
63
+ } ) }
64
+
65
+ $a = [ ]
66
+
67
+ q = Qron . new ( tab : 'test/qrontab' )
68
+
69
+ sleep 2.1
70
+
71
+ assert $a. count { |e | e == 'six' } > 1
72
+ assert $a. count { |e | e == 'Europe/Budapest' } > 1
73
+ end
56
74
end
57
75
You can’t perform that action at this time.
0 commit comments