Skip to content

Commit 596bca7

Browse files
committed
Add spec for NullDataloader#run_isolated
1 parent 7db9f23 commit 596bca7

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# frozen_string_literal: true
2+
require "spec_helper"
3+
4+
describe "GraphQL NullDataloader" do
5+
it "can run_isolated with previously-captured blocks that register lazies" do
6+
dl = GraphQL::Dataloader::NullDataloader.new
7+
result = 0
8+
dl.run_isolated {
9+
lazy = GraphQL::Execution::Lazy.new { result = 100 }
10+
dl.lazy_at_depth(1, lazy)
11+
}
12+
assert_equal 100, result
13+
end
14+
end

0 commit comments

Comments
 (0)