Skip to content

Commit

Permalink
Update for Ruby 3.3.3 **{} changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rmosolgo committed Jun 12, 2024
1 parent 490db95 commit eda220b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spec/graphql/dataloader/source_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ def fetch(keys)

source_cache = dl.instance_variable_get(:@source_cache)
source_cache_for_source = source_cache[FailsToLoadSource]
source_inst = source_cache_for_source[[{}]]

# The value of this changed in Ruby 3.3.3, see https://bugs.ruby-lang.org/issues/20180
# In previous versions, it was `[{}]`, but now it's `[]`
empty_batch_key = [*[], **{}]
source_inst = source_cache_for_source[empty_batch_key]
assert_instance_of FailsToLoadSource, source_inst, "The cache includes a pending source (#{source_cache_for_source.inspect})"
assert source_inst.pending?
end
Expand Down

0 comments on commit eda220b

Please sign in to comment.