test/answer/parser/base_test.rb in whois-0.8.0 vs test/answer/parser/base_test.rb in whois-0.8.1

- old
+ new

@@ -17,11 +17,31 @@ def test_initialize_should_require_part assert_raise(ArgumentError) { @klass.new } end + def test_supported? + klass = Class.new(@klass) do + register_method(:disclaimer) {} + end + assert klass.new(@part).supported?(:disclaimer) + assert klass.new(@part).respond_to?(:disclaimer) + + klass = Class.new(@klass) do + end + assert !klass.new(@part).supported?(:disclaimer) + assert klass.new(@part).respond_to?(:disclaimer) + end + + def test_supported_should_return_false_unless_registrable_method + parser = @klass.new(@part) + assert !parser.supported?(:content) + assert parser.respond_to?(:content) + end + + def test_content parser = @klass.new(@part) assert_equal @part.response, parser.content end - + end \ No newline at end of file