Skip to content

Commit a9a8eaf

Browse files
Merge pull request #7 from QuentinGruber/use_opts_in_unit_tests
use opts value directly
2 parents 9a2c33f + b898596 commit a9a8eaf

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

lua/pomodoro/tests/pomodoro_spec.lua

+21-7
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,30 @@ describe("useless tests", function()
1313
opts.breaks_before_long = 4
1414
opts.start_at_launch = false
1515
pomodoro.setup(opts)
16-
-- TODO: use the opts value directly
17-
assert(pomodoro.work_duration == 10 * MIN_IN_MS, "Opt work_duration")
18-
assert(pomodoro.break_duration == 10 * MIN_IN_MS, "Opt break_duration")
19-
assert(pomodoro.breaks_before_long == 4, "Opt breaks_before_long")
2016
assert(
21-
pomodoro.long_break_duration == 15 * MIN_IN_MS,
17+
pomodoro.work_duration == opts.work_duration * MIN_IN_MS,
18+
"Opt work_duration"
19+
)
20+
assert(
21+
pomodoro.break_duration == opts.break_duration * MIN_IN_MS,
22+
"Opt break_duration"
23+
)
24+
assert(
25+
pomodoro.breaks_before_long == opts.breaks_before_long,
26+
"Opt breaks_before_long"
27+
)
28+
assert(
29+
pomodoro.long_break_duration == opts.long_break_duration * MIN_IN_MS,
2230
"Opt long_break_duration"
2331
)
24-
assert(pomodoro.delay_duration == 10 * MIN_IN_MS, "Opt delay_duration")
25-
assert(pomodoro.start_at_launch == false, "Opt start_at_launch")
32+
assert(
33+
pomodoro.delay_duration == opts.delay_duration * MIN_IN_MS,
34+
"Opt delay_duration"
35+
)
36+
assert(
37+
pomodoro.start_at_launch == opts.start_at_launch,
38+
"Opt start_at_launch"
39+
)
2640
end)
2741
--TODO: tests
2842
end)

0 commit comments

Comments
 (0)