Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stdlib/resolv: Resolv::DNS::Resource::Generic.create returns a class #1655

Merged
merged 2 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stdlib/resolv/0/resolv.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ end
# A generic resource abstract class.
#
class Resolv::DNS::Resource::Generic < Resolv::DNS::Resource
def self.create: (Integer type_value, Integer class_value) -> instance
def self.create: (Integer type_value, Integer class_value) -> Class

def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance

Expand Down
13 changes: 13 additions & 0 deletions test/stdlib/resolv/DNS_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -490,3 +490,16 @@ def test_close
requester, :close
end
end

class ResolvDNSResourceGenericSigletonTest < Test::Unit::TestCase
include TypeAssertions
library 'resolv'
testing 'singleton(::Resolv::DNS::Resource::Generic)'

def test_create
rrtype = assert_send_type "(Integer, Integer) -> Class",
Resolv::DNS::Resource::Generic, :create, Resolv::DNS::Resource::IN::ClassValue, 65280
assert_send_type "(String) -> ::Resolv::DNS::Resource::Generic",
rrtype, :new, ''
end
end