Skip to content

Commit 870f2a4

Browse files
committed
dep(test): remove implicit dependence on benchmark gem
Time.now is fine, and benchmark is being removed from default gems in Ruby 3.5.
1 parent 2471f45 commit 870f2a4

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

test/test_integration_pending.rb

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
require "helper"
22

3-
require "benchmark"
4-
53
class IntegrationPendingTestCase < SQLite3::TestCase
64
class ThreadSynchronizer
75
def initialize
@@ -103,12 +101,12 @@ def test_busy_timeout
103101
end
104102
synchronizer.wait_for_thread :ready_0
105103

106-
time = Benchmark.measure do
107-
assert_raise(SQLite3::BusyException) do
108-
@db.execute "insert into foo (b) values ( 'from 2' )"
109-
end
104+
start_time = Time.now
105+
assert_raise(SQLite3::BusyException) do
106+
@db.execute "insert into foo (b) values ( 'from 2' )"
110107
end
111-
assert_operator time.real * 1000, :>=, 1000
108+
end_time = Time.now
109+
assert_operator(end_time - start_time, :>=, 1.0)
112110

113111
synchronizer.send_to_thread :end_1
114112
synchronizer.close_main

0 commit comments

Comments
 (0)