Skip to content

Commit 2096c12

Browse files
authored
Merge pull request #3226 from apiology/psych-object-yaml-tag
Add `Object.yaml_tag` from psych
2 parents 05aa954 + f270f6f commit 2096c12

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

‎stdlib/psych/0/core_ext.rbs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
%a{annotate:rdoc:skip}
22
class Object
3+
def self.yaml_tag: (String url) -> String
4+
35
# <!--
46
# rdoc-file=ext/psych/lib/psych/core_ext.rb
57
# - to_yaml(options = {})

‎test/stdlib/psych_test.rb‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,20 @@ def test_to_yaml
129129
)
130130
end
131131
end
132+
133+
class PsychObjectSingletonTest < Test::Unit::TestCase
134+
include TestHelper
135+
136+
library "psych"
137+
testing "singleton(::Object)"
138+
139+
class Tagged
140+
end
141+
142+
def test_yaml_tag
143+
assert_send_type(
144+
"(::String) -> ::String",
145+
Tagged, :yaml_tag, "!rbs-test/tagged"
146+
)
147+
end
148+
end

0 commit comments

Comments
 (0)