Skip to content

Commit

Permalink
Add specs for graphql integration .ast_node_classes_defined?
Browse files Browse the repository at this point in the history
  • Loading branch information
y9v committed Sep 9, 2024
1 parent 6225fe3 commit 9522f70
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions spec/datadog/appsec/contrib/graphql/integration_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true

require 'datadog/appsec/spec_helper'
require 'datadog/appsec/contrib/graphql/integration'

RSpec.describe Datadog::AppSec::Contrib::GraphQL::Integration do
describe '.ast_node_classes_defined?' do
it 'returns true when all AST node classes are defined' do
expect(described_class.ast_node_classes_defined?).to eq(true)
end

it 'returns false when at least one of AST node classes is not defined' do
hide_const('GraphQL::Language::Nodes::Field')
expect(described_class.ast_node_classes_defined?).to eq(false)
end
end
end

0 comments on commit 9522f70

Please sign in to comment.