Skip to content

Commit 6aca707

Browse files
committed
Fix tests
1 parent 20016a9 commit 6aca707

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

spec/ruby_llm/schema_spec.rb

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -274,19 +274,6 @@
274274
additionalProperties: false
275275
})
276276
end
277-
278-
it "supports reference to the root schema" do
279-
schema_class.define :ui_element do
280-
string :element_type, enum: ["input", "button"]
281-
string :label
282-
object :sub_schema, reference: :root
283-
end
284-
285-
instance = schema_class.new
286-
json_output = instance.to_json_schema
287-
288-
expect(json_output[:schema][:properties][:ui_schema][:properties][:sub_schema]).to eq({"$ref" => "#"})
289-
end
290277
end
291278

292279
# ===========================================
@@ -326,6 +313,17 @@
326313
user_props = json_output[:schema][:properties][:user][:properties]
327314
expect(user_props[:addresses][:items]).to eq({"$ref" => "#/$defs/address"})
328315
end
316+
317+
it "supports reference to the root schema" do
318+
schema_class.string :element_type, enum: ["input", "button"]
319+
schema_class.string :label
320+
schema_class.object :sub_schema, reference: :root
321+
322+
instance = schema_class.new
323+
json_output = instance.to_json_schema
324+
325+
expect(json_output[:schema][:properties][:sub_schema]).to eq({"$ref" => "#"})
326+
end
329327
end
330328

331329
# ===========================================

0 commit comments

Comments
 (0)