File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -681,4 +681,22 @@ def pet(name:)
681681 end
682682 end
683683 end
684+
685+ describe ".comment" do
686+ it "isn't inherited" do
687+ int1 = Module . new do
688+ include GraphQL ::Schema ::Interface
689+ graphql_name "Int1"
690+ comment "TODO: fix this"
691+ end
692+
693+ int2 = Module . new do
694+ include int1
695+ graphql_name "Int2"
696+ end
697+
698+ assert_equal "TODO: fix this" , int1 . comment
699+ assert_nil int2 . comment
700+ end
701+ end
684702end
Original file line number Diff line number Diff line change @@ -489,4 +489,22 @@ def self.wrap(obj, ctx)
489489 assert_equal expected_log , log
490490 end
491491 end
492+
493+ describe ".comment" do
494+ it "isn't inherited and can be set to nil" do
495+ obj1 = Class . new ( GraphQL ::Schema ::Object ) do
496+ graphql_name "Obj1"
497+ comment "TODO: fix this"
498+ end
499+
500+ obj2 = Class . new ( obj1 ) do
501+ graphql_name ( "Obj2" )
502+ end
503+
504+ assert_equal "TODO: fix this" , obj1 . comment
505+ assert_nil obj2 . comment
506+ obj1 . comment ( nil )
507+ assert_nil obj1 . comment
508+ end
509+ end
492510end
You can’t perform that action at this time.
0 commit comments