@@ -7,31 +7,31 @@ class Tool
77 class AnnotationsTest < ActiveSupport ::TestCase
88 test "Tool::Annotations initializes with all properties" do
99 annotations = Tool ::Annotations . new (
10- title : "Test Tool" ,
11- read_only_hint : true ,
1210 destructive_hint : false ,
1311 idempotent_hint : true ,
1412 open_world_hint : false ,
13+ read_only_hint : true ,
14+ title : "Test Tool" ,
1515 )
1616
17- assert_equal "Test Tool" , annotations . title
18- assert annotations . read_only_hint
1917 refute annotations . destructive_hint
2018 assert annotations . idempotent_hint
2119 refute annotations . open_world_hint
20+ assert annotations . read_only_hint
21+ assert_equal "Test Tool" , annotations . title
2222 end
2323
2424 test "Tool::Annotations initializes with partial properties" do
2525 annotations = Tool ::Annotations . new (
26- title : "Test Tool" ,
2726 read_only_hint : true ,
27+ title : "Test Tool" ,
2828 )
2929
30- assert_equal "Test Tool" , annotations . title
30+ assert annotations . destructive_hint
31+ refute annotations . idempotent_hint
32+ assert annotations . open_world_hint
3133 assert annotations . read_only_hint
32- assert_nil annotations . destructive_hint
33- assert_nil annotations . idempotent_hint
34- assert_nil annotations . open_world_hint
34+ assert_equal "Test Tool" , annotations . title
3535 end
3636
3737 test "Tool::Annotations#to_h omits nil values" do
@@ -41,34 +41,37 @@ class AnnotationsTest < ActiveSupport::TestCase
4141 )
4242
4343 expected = {
44- title : "Test Tool" ,
44+ destructiveHint : true ,
45+ idempotentHint : false ,
46+ openWorldHint : true ,
4547 readOnlyHint : true ,
48+ title : "Test Tool" ,
4649 }
4750 assert_equal expected , annotations . to_h
4851 end
4952
5053 test "Tool::Annotations#to_h handles all properties" do
5154 annotations = Tool ::Annotations . new (
52- title : "Test Tool" ,
53- read_only_hint : true ,
5455 destructive_hint : false ,
5556 idempotent_hint : true ,
5657 open_world_hint : false ,
58+ read_only_hint : true ,
59+ title : "Test Tool" ,
5760 )
5861
5962 expected = {
60- title : "Test Tool" ,
61- readOnlyHint : true ,
6263 destructiveHint : false ,
6364 idempotentHint : true ,
6465 openWorldHint : false ,
66+ readOnlyHint : true ,
67+ title : "Test Tool" ,
6568 }
6669 assert_equal expected , annotations . to_h
6770 end
6871
69- test "Tool::Annotations#to_h returns empty hash when all values are nil " do
72+ test "Tool::Annotations#to_h returns hash with default hint values " do
7073 annotations = Tool ::Annotations . new
71- assert_empty annotations . to_h
74+ assert_equal ( { destructiveHint : true , idempotentHint : false , openWorldHint : true , readOnlyHint : false } , annotations . to_h )
7275 end
7376 end
7477 end
0 commit comments