Skip to content

Commit

Permalink
Search for expected add-on in test (#3106)
Browse files Browse the repository at this point in the history
### Motivation

This test is flaky because sometimes `Addon.addons.first` returns the RuboCop add-on instead of the one defined in the test.

Let's avoid having this test be order dependent.
  • Loading branch information
vinistock committed Jan 29, 2025
1 parent 9f0f8f2 commit eac6f3c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/addon_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ def test_registering_an_addon_invokes_activate_on_initialized

def test_addons_are_automatically_tracked
Addon.load_addons(@global_state, @outgoing_queue)
assert_equal(123, T.unsafe(Addon.addons.first).field)

addon = Addon.addons.find { |addon| addon.is_a?(@addon) }
assert_equal(123, T.unsafe(addon).field)
end

def test_loading_addons_initializes_them
Expand Down

0 comments on commit eac6f3c

Please sign in to comment.