Skip to content

Commit

Permalink
Debug source cache
Browse files Browse the repository at this point in the history
  • Loading branch information
rmosolgo committed Jun 12, 2024
1 parent 2e8dfaa commit 490db95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 0 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion spec/graphql/dataloader/source_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 490db95

Please sign in to comment.