Skip to content

Commit

Permalink
Sort specs
Browse files Browse the repository at this point in the history
  • Loading branch information
weppos committed Jan 30, 2012
1 parent 06ce8de commit 2373fba
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 69 deletions.
Expand Up @@ -2,9 +2,11 @@
should_not: %s be_empty
should: %s =~ /^#/


#domain
should: %s == "dr-foo-bar-baz.chirurgiens-dentistes.fr"


#status
should: %s == :active

Expand All @@ -14,6 +16,7 @@
#registered?
should: %s == true


#created_on
should: %s be_a(Time)
should: %s == Time.parse("2011-01-13 15:45:18")
Expand All @@ -26,56 +29,61 @@
should: %s be_a(Time)
should: %s == Time.parse("2012-01-13 16:00:09 +01:00")


#registrar
should: %s be_a(_registrar)
should: %s.name == "GOOGLE"
should: %s.id == nil
should: %s.name == "GOOGLE"
should: %s.organization == "GOOGLE"
should: %s.url == "http://www.google.com"

#nameservers
should: %s be_a(Array)
should: %s have(4).items
should: %s[0] be_a(_nameserver)
should: %s[0].name == "ns1.google.com"
should: %s[1] be_a(_nameserver)
should: %s[1].name == "ns2.google.com"
should: %s[2] be_a(_nameserver)
should: %s[2].name == "ns3.google.com"
should: %s[3] be_a(_nameserver)
should: %s[3].name == "ns4.google.com"
should: %s.url == "http://www.google.com"

#registrant_contacts
should: %s be_a(Array)
should: %s have(1).item
should: %s[0] be_a(_contact)
should: %s[0].id == "FBB1-SMALL"
should: %s[0].name == "FOO BAR BAZ"
should: %s[0].organization == "FOO BAR BAZ INC"
should: %s[0].type == Whois::Record::Contact::TYPE_REGISTRANT
should: %s[0].address == "116 RUE DE LA PAIX\n75001 PARIS\nFRANCE"
should: %s[0].phone == "+33.123456651"
should: %s[0].fax == "+33.123456660"
should: %s[0].updated_on == Time.parse("2011-01-13 15:45:18 +01:00")
should: %s[0].type == Whois::Record::Contact::TYPE_REGISTRANT
should: %s[0].id == "FBB1-SMALL"
should: %s[0].name == "FOO BAR BAZ"
should: %s[0].organization == "FOO BAR BAZ INC"
should: %s[0].address == "116 RUE DE LA PAIX\n75001 PARIS\nFRANCE"
should: %s[0].phone == "+33.123456651"
should: %s[0].fax == "+33.123456660"
should: %s[0].updated_on == Time.parse("2011-01-13 15:45:18 +01:00")

#admin_contacts
should: %s be_a(Array)
should: %s have(1).item
should: %s[0] be_a(_contact)
should: %s[0].id == "QR1-SMALL"
should: %s[0].organization == "QWE RTY"
should: %s[0].type == Whois::Record::Contact::TYPE_ADMIN
should: %s[0].address == "13 RUE DE LA PAIX\n75003 PARIS\nFRANCE"
should: %s[0].phone == "+33.144887967"
should: %s[0].updated_on == Time.parse("2010-08-02 14:48:21 +02:00")
should: %s[0].type == Whois::Record::Contact::TYPE_ADMIN
should: %s[0].id == "QR1-SMALL"
should: %s[0].name == nil
should: %s[0].organization == "QWE RTY"
should: %s[0].address == "13 RUE DE LA PAIX\n75003 PARIS\nFRANCE"
should: %s[0].phone == "+33.144887967"
should: %s[0].updated_on == Time.parse("2010-08-02 14:48:21 +02:00")

#technical_contacts
should: %s be_a(Array)
should: %s have(1).item
should: %s[0] be_a(_contact)
should: %s[0].id == "GOOG-SMALL"
should: %s[0].organization == "GOOGLE DNS MASTER"
should: %s[0].type == Whois::Record::Contact::TYPE_TECHNICAL
should: %s[0].address == "GOOGLE\n22, RUE DE LA PAIX\n75008 PARIS\nFRANCE"
should: %s[0].phone == "+33.821845353"
should: %s[0].fax == "+33.821845354"
should: %s[0].updated_on == Time.parse("2011-05-18 09:35:37 +02:00")
should: %s[0].type == Whois::Record::Contact::TYPE_TECHNICAL
should: %s[0].id == "GOOG-SMALL"
should: %s[0].name == nil
should: %s[0].organization == "GOOGLE DNS MASTER"
should: %s[0].address == "GOOGLE\n22, RUE DE LA PAIX\n75008 PARIS\nFRANCE"
should: %s[0].phone == "+33.821845353"
should: %s[0].fax == "+33.821845354"
should: %s[0].updated_on == Time.parse("2011-05-18 09:35:37 +02:00")


#nameservers
should: %s be_a(Array)
should: %s have(4).items
should: %s[0] be_a(_nameserver)
should: %s[0].name == "ns1.google.com"
should: %s[1] be_a(_nameserver)
should: %s[1].name == "ns2.google.com"
should: %s[2] be_a(_nameserver)
should: %s[2].name == "ns3.google.com"
should: %s[3] be_a(_nameserver)
should: %s[3].name == "ns4.google.com"
Expand Up @@ -68,65 +68,68 @@
describe "#registrar" do
it do
@parser.registrar.should be_a(_registrar)
@parser.registrar.name.should == "GOOGLE"
@parser.registrar.id.should == nil
@parser.registrar.name.should == "GOOGLE"
@parser.registrar.organization.should == "GOOGLE"
@parser.registrar.url.should == "http://www.google.com"
end
end
describe "#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"
@parser.registrar.url.should == "http://www.google.com"
end
end
describe "#registrant_contacts" do
it do
@parser.registrant_contacts.should be_a(Array)
@parser.registrant_contacts.should have(1).item
@parser.registrant_contacts[0].should be_a(_contact)
@parser.registrant_contacts[0].id.should == "FBB1-SMALL"
@parser.registrant_contacts[0].name.should == "FOO BAR BAZ"
@parser.registrant_contacts[0].type.should == Whois::Record::Contact::TYPE_REGISTRANT
@parser.registrant_contacts[0].id.should == "FBB1-SMALL"
@parser.registrant_contacts[0].name.should == "FOO BAR BAZ"
@parser.registrant_contacts[0].organization.should == "FOO BAR BAZ INC"
@parser.registrant_contacts[0].type.should == Whois::Record::Contact::TYPE_REGISTRANT
@parser.registrant_contacts[0].address.should == "116 RUE DE LA PAIX\n75001 PARIS\nFRANCE"
@parser.registrant_contacts[0].phone.should == "+33.123456651"
@parser.registrant_contacts[0].fax.should == "+33.123456660"
@parser.registrant_contacts[0].updated_on.should == Time.parse("2011-01-13 15:45:18 +01:00")
@parser.registrant_contacts[0].address.should == "116 RUE DE LA PAIX\n75001 PARIS\nFRANCE"
@parser.registrant_contacts[0].phone.should == "+33.123456651"
@parser.registrant_contacts[0].fax.should == "+33.123456660"
@parser.registrant_contacts[0].updated_on.should == Time.parse("2011-01-13 15:45:18 +01:00")
end
end
describe "#admin_contacts" do
it do
@parser.admin_contacts.should be_a(Array)
@parser.admin_contacts.should have(1).item
@parser.admin_contacts[0].should be_a(_contact)
@parser.admin_contacts[0].id.should == "QR1-SMALL"
@parser.admin_contacts[0].type.should == Whois::Record::Contact::TYPE_ADMIN
@parser.admin_contacts[0].id.should == "QR1-SMALL"
@parser.admin_contacts[0].name.should == nil
@parser.admin_contacts[0].organization.should == "QWE RTY"
@parser.admin_contacts[0].type.should == Whois::Record::Contact::TYPE_ADMIN
@parser.admin_contacts[0].address.should == "13 RUE DE LA PAIX\n75003 PARIS\nFRANCE"
@parser.admin_contacts[0].phone.should == "+33.144887967"
@parser.admin_contacts[0].updated_on.should == Time.parse("2010-08-02 14:48:21 +02:00")
@parser.admin_contacts[0].address.should == "13 RUE DE LA PAIX\n75003 PARIS\nFRANCE"
@parser.admin_contacts[0].phone.should == "+33.144887967"
@parser.admin_contacts[0].updated_on.should == Time.parse("2010-08-02 14:48:21 +02:00")
end
end
describe "#technical_contacts" do
it do
@parser.technical_contacts.should be_a(Array)
@parser.technical_contacts.should have(1).item
@parser.technical_contacts[0].should be_a(_contact)
@parser.technical_contacts[0].id.should == "GOOG-SMALL"
@parser.technical_contacts[0].type.should == Whois::Record::Contact::TYPE_TECHNICAL
@parser.technical_contacts[0].id.should == "GOOG-SMALL"
@parser.technical_contacts[0].name.should == nil
@parser.technical_contacts[0].organization.should == "GOOGLE DNS MASTER"
@parser.technical_contacts[0].type.should == Whois::Record::Contact::TYPE_TECHNICAL
@parser.technical_contacts[0].address.should == "GOOGLE\n22, RUE DE LA PAIX\n75008 PARIS\nFRANCE"
@parser.technical_contacts[0].phone.should == "+33.821845353"
@parser.technical_contacts[0].fax.should == "+33.821845354"
@parser.technical_contacts[0].updated_on.should == Time.parse("2011-05-18 09:35:37 +02:00")
@parser.technical_contacts[0].address.should == "GOOGLE\n22, RUE DE LA PAIX\n75008 PARIS\nFRANCE"
@parser.technical_contacts[0].phone.should == "+33.821845353"
@parser.technical_contacts[0].fax.should == "+33.821845354"
@parser.technical_contacts[0].updated_on.should == Time.parse("2011-05-18 09:35:37 +02:00")
end
end
describe "#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

0 comments on commit 2373fba

Please sign in to comment.