-
-
Notifications
You must be signed in to change notification settings - Fork 283
/
status_registered_spec.rb
109 lines (104 loc) · 3.68 KB
/
status_registered_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# encoding: utf-8
# This file is autogenerated. Do not edit it manually.
# If you want change the content of this file, edit
#
# /spec/fixtures/responses/whois.ripn.net/ru/status_registered.expected
#
# and regenerate the tests with the following rake task
#
# $ rake genspec:parsers
#
require 'spec_helper'
require 'whois/record/parser/whois.ripn.net.rb'
describe Whois::Record::Parser::WhoisRipnNet, "status_registered.expected" do
before(:each) do
file = fixture("responses", "whois.ripn.net/ru/status_registered.txt")
part = Whois::Record::Part.new(:body => File.read(file))
@parser = klass.new(part)
end
context "#status" do
it do
@parser.status.should == ["REGISTERED", "DELEGATED", "VERIFIED"]
end
end
context "#available?" do
it do
@parser.available?.should == false
end
end
context "#registered?" do
it do
@parser.registered?.should == true
end
end
context "#created_on" do
it do
@parser.created_on.should be_a(Time)
@parser.created_on.should == Time.parse("2004-03-04")
end
end
context "#updated_on" do
it do
lambda { @parser.updated_on }.should raise_error(Whois::PropertyNotSupported)
end
end
context "#expires_on" do
it do
@parser.expires_on.should be_a(Time)
@parser.expires_on.should == Time.parse("2011-03-05")
end
end
context "#registrar" do
it do
@parser.registrar.should be_a(_registrar)
@parser.registrar.id.should == "RUCENTER-REG-RIPN"
@parser.registrar.name.should == nil
@parser.registrar.organization.should == nil
end
end
context "#registrant_contacts" do
it do
lambda { @parser.registrant_contacts }.should raise_error(Whois::PropertyNotSupported)
end
end
context "#admin_contacts" do
it do
@parser.admin_contacts.should be_a(Array)
@parser.admin_contacts.should have(2).items
@parser.admin_contacts[0].should be_a(_contact)
@parser.admin_contacts[0].type.should == Whois::Record::Contact::TYPE_ADMIN
@parser.admin_contacts[0].id.should == nil
@parser.admin_contacts[0].name.should == nil
@parser.admin_contacts[0].organization.should == "Google Inc"
@parser.admin_contacts[0].phone.should == "+1 650 330 0100"
@parser.admin_contacts[0].fax.should == "+1 650 618 8571"
@parser.admin_contacts[0].email.should == "dns-admin@google.com"
@parser.admin_contacts[1].type.should == Whois::Record::Contact::TYPE_ADMIN
@parser.admin_contacts[1].id.should == nil
@parser.admin_contacts[1].name.should == nil
@parser.admin_contacts[1].organization.should == "Google Inc"
@parser.admin_contacts[1].phone.should == "+1 650 330 0100"
@parser.admin_contacts[1].fax.should == "+1 650 618 8571"
@parser.admin_contacts[1].email.should == "ccops@markmonitor.com"
end
end
context "#technical_contacts" do
it do
lambda { @parser.technical_contacts }.should raise_error(Whois::PropertyNotSupported)
end
end
context "#nameservers" do
it do
@parser.nameservers.should be_a(Array)
@parser.nameservers.should have(4).items
@parser.nameservers[0].should be_a(_nameserver)
@parser.nameservers[0].name.should == "ns1.google.com"
@parser.nameservers[1].should be_a(_nameserver)
@parser.nameservers[1].name.should == "ns2.google.com"
@parser.nameservers[2].should be_a(_nameserver)
@parser.nameservers[2].name.should == "ns3.google.com"
@parser.nameservers[3].should be_a(_nameserver)
@parser.nameservers[3].name.should == "ns4.google.com"
end
end
end