test/answer/parser/base_test.rb in whois-1.0.12 vs test/answer/parser/base_test.rb in whois-1.1.0
- old
+ new
@@ -43,9 +43,27 @@
assert klass.new(@part).property_supported?(:disclaimer)
assert klass.new(@part).respond_to?(:disclaimer)
end
+ def test_contacts_should_return_empty_array_with_all_unsupported
+ parser = @klass.new(@part)
+ assert_equal [], parser.contacts
+ end
+
+ def test_contacts_should_return_all_supported_contacts
+ c1 = "1st"
+ c2 = "2nd"
+ c3 = "3rd"
+ klass = Class.new(@klass) do
+ register_property(:registrant_contact, :supported) { [c1, c2] }
+ register_property(:admin_contact, :supported) { nil }
+ register_property(:technical_contact, :supported) { c3 }
+ end
+ assert_equal [c1, c2, c3], klass.new(@part).contacts
+ end
+
+
def test_self_property_registry
assert_instance_of Hash, @klass.property_registry
end
def test_self_property_registry_with_klass
\ No newline at end of file