From 490db9585f015d95e48e699382eed05b30ff3988 Mon Sep 17 00:00:00 2001 From: Robert Mosolgo Date: Wed, 12 Jun 2024 07:34:46 -0400 Subject: [PATCH] Debug source cache --- Rakefile | 3 --- spec/graphql/dataloader/source_spec.rb | 4 +++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Rakefile b/Rakefile index 5b1b4b6ff3..5ff452ab8e 100644 --- a/Rakefile +++ b/Rakefile @@ -30,10 +30,7 @@ Rake::TestTask.new do |t| # After 2.7, there were not warnings for uninitialized ivars anymore if RUBY_VERSION < "3" - puts "Disabling warnings on Ruby #{RUBY_VERSION.inspect}" t.warning = false - else - puts "Enabling warnings on Ruby #{RUBY_VERSION.inspect}" end end diff --git a/spec/graphql/dataloader/source_spec.rb b/spec/graphql/dataloader/source_spec.rb index 6aada921dd..8c6320728e 100644 --- a/spec/graphql/dataloader/source_spec.rb +++ b/spec/graphql/dataloader/source_spec.rb @@ -24,7 +24,9 @@ def fetch(keys) source_cache = dl.instance_variable_get(:@source_cache) source_cache_for_source = source_cache[FailsToLoadSource] - assert source_cache_for_source[[{}]].pending?, "The cache includes a pending source (#{source_cache_for_source.inspect})" + source_inst = source_cache_for_source[[{}]] + assert_instance_of FailsToLoadSource, source_inst, "The cache includes a pending source (#{source_cache_for_source.inspect})" + assert source_inst.pending? end class CustomKeySource < GraphQL::Dataloader::Source