Skip to content

Commit bab5bd0

Browse files
committed
fix flaky test
1 parent 40b7a7c commit bab5bd0

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

test/sandbox/test/inline_template_test.rb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -216,15 +216,17 @@ class InlineComponentDerivedFromComponentSupportingVariants < Level2Component
216216
skip unless Rails::VERSION::MAJOR >= 8 && Rails::VERSION::MINOR > 0
217217

218218
without_template_annotations do
219-
with_coverage_running do
220-
# Force recompilation with coverage "enabled" but annotations disabled
221-
ViewComponent::CompileCache.cache.delete(ErbComponent)
219+
with_new_cache do
220+
with_coverage_running do
221+
# Force recompilation with coverage "enabled" but annotations disabled
222+
ViewComponent::CompileCache.cache.delete(ErbComponent)
222223

223-
# This would segfault in v4.3.0 because it only avoided -1 lineno
224-
# when annotations were enabled
225-
render_inline(ErbComponent.new(message: "Foo bar"))
224+
# This would segfault in v4.3.0 because it only avoided -1 lineno
225+
# when annotations were enabled
226+
render_inline(ErbComponent.new(message: "Foo bar"))
226227

227-
assert_selector("div", text: "Foo bar")
228+
assert_selector("div", text: "Foo bar")
229+
end
228230
end
229231
end
230232
end

0 commit comments

Comments
 (0)