diff --git a/lib/whois/parsers/whois.rotld.ro.rb b/lib/whois/parsers/whois.rotld.ro.rb index 9c8aa41d..63ff47cd 100644 --- a/lib/whois/parsers/whois.rotld.ro.rb +++ b/lib/whois/parsers/whois.rotld.ro.rb @@ -45,13 +45,19 @@ class WhoisRotldRo < Base !available? end - - property_not_supported :created_on + property_supported :created_on do + if content_for_scanner =~ /Registered On:\s+(.+?)\n/ + parse_time($1) + end + end property_not_supported :updated_on - property_not_supported :expires_on - + property_supported :expires_on do + if content_for_scanner =~ /Expires On:\s+(.+?)\n/ + parse_time($1) + end + end property_supported :nameservers do content_for_scanner.scan(/Nameserver:\s+(.+)\n/).flatten.map do |name| diff --git a/spec/fixtures/responses/whois.rotld.ro/ro/property_status_updateprohibited.txt b/spec/fixtures/responses/whois.rotld.ro/ro/property_status_updateprohibited.txt index 02416369..dc987ca1 100644 --- a/spec/fixtures/responses/whois.rotld.ro/ro/property_status_updateprohibited.txt +++ b/spec/fixtures/responses/whois.rotld.ro/ro/property_status_updateprohibited.txt @@ -13,16 +13,19 @@ % Top Level Domain : ro % Maintainance : www.rotld.ro - Domain Name: google.ro - Registered On: 2000-07-17 - Registrar: MarkMonitor Inc. - Referral URL: - - Nameserver: ns4.google.com - Nameserver: ns1.google.com - Nameserver: ns3.google.com - Nameserver: ns2.google.com - - Domain Status: UpdateProhibited - - + Domain Name: google.ro + Registered On: 2000-07-17 + Expires On: 2018-09-17 + Registrar: MarkMonitor Inc. + Referral URL: www.markmonitor.com + + DNSSEC: Inactive + + Nameserver: ns1.google.com + Nameserver: ns2.google.com + Nameserver: ns3.google.com + Nameserver: ns4.google.com + + Domain Status: UpdateProhibited + + diff --git a/spec/fixtures/responses/whois.rotld.ro/ro/status_available.expected b/spec/fixtures/responses/whois.rotld.ro/ro/status_available.expected index 982cebd7..47ed7904 100644 --- a/spec/fixtures/responses/whois.rotld.ro/ro/status_available.expected +++ b/spec/fixtures/responses/whois.rotld.ro/ro/status_available.expected @@ -9,13 +9,15 @@ #created_on - %s %ERROR{AttributeNotSupported} + %s %CLASS{time} + %s %TIME{2000-07-17 00:00:00.000000000 +0000} #updated_on %s %ERROR{AttributeNotSupported} #expires_on - %s %ERROR{AttributeNotSupported} + %s %CLASS{time} + %s %TIME{2000-07-17 00:00:00.000000000 +0000} #nameservers diff --git a/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.expected b/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.expected index a287bbdc..ca131cc6 100644 --- a/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.expected +++ b/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.expected @@ -9,13 +9,15 @@ #created_on - %s %ERROR{AttributeNotSupported} + %s %CLASS{time} + %s %TIME{2000-07-17 00:00:00.000000000 +0000} #updated_on %s %ERROR{AttributeNotSupported} #expires_on - %s %ERROR{AttributeNotSupported} + %s %CLASS{time} + %s %TIME{2000-07-17 00:00:00.000000000 +0000} #nameservers diff --git a/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.txt b/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.txt index fb084973..dc987ca1 100644 --- a/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.txt +++ b/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.txt @@ -13,16 +13,19 @@ % Top Level Domain : ro % Maintainance : www.rotld.ro - Domain Name: google.ro - Registered On: 2000-07-17 - Registrar: MarkMonitor Inc. - Referral URL: http://www.markmonitor.com - - Nameserver: ns1.google.com - Nameserver: ns2.google.com - Nameserver: ns3.google.com - Nameserver: ns4.google.com - - Domain Status: UpdateProhibited - - + Domain Name: google.ro + Registered On: 2000-07-17 + Expires On: 2018-09-17 + Registrar: MarkMonitor Inc. + Referral URL: www.markmonitor.com + + DNSSEC: Inactive + + Nameserver: ns1.google.com + Nameserver: ns2.google.com + Nameserver: ns3.google.com + Nameserver: ns4.google.com + + Domain Status: UpdateProhibited + + diff --git a/spec/whois/parsers/responses/whois.rotld.ro/ro/status_available_spec.rb b/spec/whois/parsers/responses/whois.rotld.ro/ro/status_available_spec.rb index f67eef3b..0cd5abf8 100644 --- a/spec/whois/parsers/responses/whois.rotld.ro/ro/status_available_spec.rb +++ b/spec/whois/parsers/responses/whois.rotld.ro/ro/status_available_spec.rb @@ -38,7 +38,7 @@ end describe "#created_on" do it do - expect { subject.created_on }.to raise_error(Whois::AttributeNotSupported) + expect(subject.created_on).to eq(nil) end end describe "#updated_on" do @@ -48,7 +48,7 @@ end describe "#expires_on" do it do - expect { subject.expires_on }.to raise_error(Whois::AttributeNotSupported) + expect(subject.created_on).to eq(nil) end end describe "#nameservers" do diff --git a/spec/whois/parsers/responses/whois.rotld.ro/ro/status_registered_spec.rb b/spec/whois/parsers/responses/whois.rotld.ro/ro/status_registered_spec.rb index bf6e20a6..9c4d7ee7 100644 --- a/spec/whois/parsers/responses/whois.rotld.ro/ro/status_registered_spec.rb +++ b/spec/whois/parsers/responses/whois.rotld.ro/ro/status_registered_spec.rb @@ -38,7 +38,7 @@ end describe "#created_on" do it do - expect { subject.created_on }.to raise_error(Whois::AttributeNotSupported) + expect(subject.created_on).to eq(Time.parse("2000-07-17 00:00:00.000000000 +0000")) end end describe "#updated_on" do @@ -48,7 +48,7 @@ end describe "#expires_on" do it do - expect { subject.expires_on }.to raise_error(Whois::AttributeNotSupported) + expect(subject.created_on).to eq(Time.parse("2000-07-17 00:00:00.000000000 +0000")) end end describe "#nameservers" do