spec/graphql/schema/timeout_middleware_spec.rb in graphql-0.19.4 vs spec/graphql/schema/timeout_middleware_spec.rb in graphql-1.0.0

- old
+ new

@@ -164,11 +164,11 @@ end describe "with a custom block" do let(:timeout_middleware) { GraphQL::Schema::TimeoutMiddleware.new(max_seconds: max_seconds) do |err, query| - raise("Query timed out after 2s: #{query.class.name}") + raise("Query timed out after 2s: #{query.class.name} on #{query.context.ast_node.alias}") end } let(:query_string) {%| { a: sleepFor(seconds: 0.4) @@ -178,9 +178,10 @@ e: sleepFor(seconds: 0.4) } |} it "calls the block" do - assert_raises(RuntimeError) { result } + err = assert_raises(RuntimeError) { result } + assert_equal "Query timed out after 2s: GraphQL::Query on d", err.message end end end