35 lines
1013 B
Diff
35 lines
1013 B
Diff
|
|
diff --git a/test/integration/context_test.rb b/test/integration/context_test.rb
|
||
|
|
index 58f1c33..b8dcc5f 100644
|
||
|
|
--- a/test/integration/context_test.rb
|
||
|
|
+++ b/test/integration/context_test.rb
|
||
|
|
@@ -458,13 +458,6 @@ class ContextTest < Minitest::Test
|
||
|
|
assert_equal(@context, @context['category'].context)
|
||
|
|
end
|
||
|
|
|
||
|
|
- def test_interrupt_avoids_object_allocations
|
||
|
|
- @context.interrupt? # ruby 3.0.0 allocates on the first call
|
||
|
|
- assert_no_object_allocations do
|
||
|
|
- @context.interrupt?
|
||
|
|
- end
|
||
|
|
- end
|
||
|
|
-
|
||
|
|
def test_context_initialization_with_a_proc_in_environment
|
||
|
|
contx = Context.new([test: ->(c) { c['poutine'] }], test: :foo)
|
||
|
|
|
||
|
|
@@ -620,15 +613,4 @@ class ContextTest < Minitest::Test
|
||
|
|
|
||
|
|
private
|
||
|
|
|
||
|
|
- def assert_no_object_allocations
|
||
|
|
- unless RUBY_ENGINE == 'ruby'
|
||
|
|
- skip("stackprof needed to count object allocations")
|
||
|
|
- end
|
||
|
|
- require 'stackprof'
|
||
|
|
-
|
||
|
|
- profile = StackProf.run(mode: :object) do
|
||
|
|
- yield
|
||
|
|
- end
|
||
|
|
- assert_equal(0, profile[:samples])
|
||
|
|
- end
|
||
|
|
end # ContextTest
|