File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 4
4
5
5
class BenchmarkTest < ActiveSupport ::TestCase
6
6
def test_realtime
7
- time = ActiveSupport ::Benchmark . realtime { sleep 0.1 }
8
- assert_in_delta 0.1 , time , 0.0005
7
+ time = ActiveSupport ::Benchmark . realtime { sleep 0.01 }
8
+ assert_includes ( 0.01 .. 0.02 ) , time
9
9
end
10
10
11
11
def test_realtime_millisecond
12
- ms = ActiveSupport ::Benchmark . realtime ( :float_millisecond ) { sleep 0.1 }
13
- assert_in_delta 100 , ms , 0.5
12
+ ms = ActiveSupport ::Benchmark . realtime ( :float_millisecond ) { sleep 0.01 }
13
+ assert_includes ( 10 .. 20 ) , ms
14
14
end
15
15
end
Original file line number Diff line number Diff line change 6
6
class BenchmarkTest < ActiveSupport ::TestCase
7
7
def test_is_deprecated
8
8
assert_deprecated ( ActiveSupport . deprecator ) do
9
- assert_operator Benchmark . ms { } , :> , 0
9
+ assert_kind_of Numeric , Benchmark . ms { }
10
10
end
11
11
end
12
12
end
You can’t perform that action at this time.
0 commit comments