Add bin and edit workflow
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 9s

This commit is contained in:
2026-09-16 13:11:16 -06:00
parent c8ac4fcae5
commit 4cee170d66
17576 changed files with 895740 additions and 2 deletions
@@ -0,0 +1,62 @@
covers 'facets/timer'
test_case Timer do
class_method :time do
test "can keep time of a block" do
Timer.time do |timer|
timer.total_time.round.assert == 0
sleep 1
timer.total_time.round.assert == 1
end
end
test "can be stopped" do
Timer.time do |timer|
sleep 0.4
timer.stop
sleep 0.6
timer.total_time.round.assert == 0
end
end
test "timer can be started again" do
Timer.time do |timer|
timer.stop
sleep 0.5
timer.total_time.round.assert == 0
timer.start
sleep 1
timer.total_time.round.assert == 1
end
end
end
method :start do
test "out of time" do
t = Timer.new(0.5)
expect Timeout::Error do
t.start
sleep 1
t.stop
end
end
test "in time" do
t = Timer.new(2)
t.start
sleep 0.5
t.stop
end
end
method :stop do
test "in time" do
t = Timer.new(2)
t.start
sleep 0.5
t.stop
end
end
end