-
-
Notifications
You must be signed in to change notification settings - Fork 283
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecated Whois::Answer::Part#response.
- Loading branch information
Showing
6 changed files
with
92 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
require 'test_helper' | ||
|
||
class Whois::Answer::PartTest < Test::Unit::TestCase | ||
|
||
def setup | ||
@klass = Whois::Answer::Part | ||
end | ||
|
||
def test_initialize_with_empty_values | ||
instance = @klass.new | ||
assert_instance_of @klass, instance | ||
assert_equal nil, instance.body | ||
|
||
instance = @klass.new({}) | ||
assert_instance_of @klass, instance | ||
assert_equal nil, instance.body | ||
end | ||
|
||
def test_initialize_with_params | ||
instance = @klass.new("This is a WHOIS record.", "whois.example.test") | ||
|
||
assert_equal "This is a WHOIS record.", instance.body | ||
assert_equal "whois.example.test", instance.host | ||
end | ||
|
||
def test_initialize_with_hash | ||
instance = @klass.new(:body => "This is a WHOIS record.", :host => "whois.example.test") | ||
|
||
assert_equal "This is a WHOIS record.", instance.body | ||
assert_equal "whois.example.test", instance.host | ||
end | ||
|
||
def test_initialize_with_block | ||
instance = @klass.new do |c| | ||
c.body = "This is a WHOIS record." | ||
c.host = "whois.example.test" | ||
end | ||
|
||
assert_equal "This is a WHOIS record.", instance.body | ||
assert_equal "whois.example.test", instance.host | ||
end | ||
|
||
|
||
def test_deprecated_response_setter | ||
instance = @klass.new(:host => "whois.example.test") | ||
instance.response = "This is a WHOIS record." | ||
|
||
assert_equal "This is a WHOIS record.", instance.body | ||
assert_equal "whois.example.test", instance.host | ||
end | ||
|
||
def test_deprecated_response_getter | ||
instance = @klass.new(:body => "This is a WHOIS record.", :host => "whois.example.test") | ||
|
||
assert_equal "This is a WHOIS record.", instance.response | ||
assert_equal "whois.example.test", instance.host | ||
end | ||
|
||
end |