2025-08-16 15:57:52 -04:00
|
|
|
require_relative "../lib/lesson"
|
|
|
|
require "minitest/autorun"
|
|
|
|
|
|
|
|
class TestLesson < Minitest::Test
|
|
|
|
def setup
|
2025-08-17 06:46:32 -04:00
|
|
|
@scheduler = Minitest::Mock.new
|
2025-08-16 15:57:52 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_start
|
2025-08-17 06:46:32 -04:00
|
|
|
@lesson = Lesson.new [[1, "test the thing"], [3, "finish testing"]], scheduler: @scheduler
|
|
|
|
@scheduler.expect(:in, nil) { |time| time == "0m" }
|
|
|
|
@scheduler.expect(:in, nil) { |time| time == "1m" }
|
|
|
|
@scheduler.expect(:in, nil) { |time| time == "4m" }
|
|
|
|
@lesson.start! nil
|
2025-08-16 15:57:52 -04:00
|
|
|
end
|
|
|
|
end
|