Skip to content

Commit

Permalink
Use Ruby 2 Hash syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
weppos committed Dec 9, 2015
1 parent 32c9ce2 commit a034215
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion spec/whois/record/part_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
end

it "initializes a new instance from given hash" do
instance = described_class.new(:body => "This is a WHOIS record.", :host => "whois.example.test")
instance = described_class.new(body: "This is a WHOIS record.", host: "whois.example.test")

expect(instance.body).to eq("This is a WHOIS record.")
expect(instance.host).to eq("whois.example.test")
Expand Down
2 changes: 1 addition & 1 deletion spec/whois/server/adapters/afilias_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
record = server.lookup("example.test")
expect(record.to_s).to eq(expected)
expect(record.parts.size).to eq(1)
expect(record.parts).to eq([Whois::Record::Part.new(:body => response, :host => "whois.afilias-grs.info")])
expect(record.parts).to eq([Whois::Record::Part.new(body: response, host: "whois.afilias-grs.info")])
end
end

Expand Down
14 changes: 7 additions & 7 deletions spec/whois/server/adapters/arin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
record = server.lookup("0.0.0.0")
expect(record.to_s).to eq(expected)
expect(record.parts.size).to eq(1)
expect(record.parts).to eq([Whois::Record::Part.new(:body => response, :host => "whois.arin.net")])
expect(record.parts).to eq([Whois::Record::Part.new(body: response, host: "whois.arin.net")])
end
end

Expand All @@ -29,8 +29,8 @@
record = server.lookup("0.0.0.0")
expect(record.to_s).to eq(expected)
expect(record.parts.size).to eq(2)
expect(record.parts).to eq([Whois::Record::Part.new(:body => referral, :host => "whois.arin.net"),
Whois::Record::Part.new(:body => response, :host => "whois.ripe.net")])
expect(record.parts).to eq([Whois::Record::Part.new(body: referral, host: "whois.arin.net"),
Whois::Record::Part.new(body: response, host: "whois.ripe.net")])
end

it "follows rwhois:// referrals" do
Expand All @@ -43,8 +43,8 @@
record = server.lookup("0.0.0.0")
expect(record.to_s).to eq(expected)
expect(record.parts.size).to eq(2)
expect(record.parts).to eq([Whois::Record::Part.new(:body => referral, :host => "whois.arin.net"),
Whois::Record::Part.new(:body => response, :host => "rwhois.servernap.net")])
expect(record.parts).to eq([Whois::Record::Part.new(body: referral, host: "whois.arin.net"),
Whois::Record::Part.new(body: response, host: "rwhois.servernap.net")])
end

it "ignores referral if options[:referral] is false" do
Expand Down Expand Up @@ -74,8 +74,8 @@

record = server.lookup("0.0.0.0")
expect(record.parts.size).to eq(2)
expect(record.parts).to eq([Whois::Record::Part.new(:body => referral, :host => "whois.arin.net"),
Whois::Record::Part.new(:body => response, :host => "whois.apnic.net")])
expect(record.parts).to eq([Whois::Record::Part.new(body: referral, host: "whois.arin.net"),
Whois::Record::Part.new(body: response, host: "whois.apnic.net")])
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/whois/server/adapters/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@

it "overrides @host if :host option exists" do
a = described_class.new(:tld, ".test", "whois.test", { :hello => "world" })
a.configure(foo: "bar", :host => "whois.example.com")
expect(a.options).to eq({ :hello => "world", foo: "bar", :host => "whois.example.com" })
a.configure(foo: "bar", host: "whois.example.com")
expect(a.options).to eq({ :hello => "world", foo: "bar", host: "whois.example.com" })
expect(a.host).to eq("whois.example.com")
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/whois/server/adapters/formatted_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

record = server.lookup("domain.de")
expect(record.to_s).to eq(expected)
expect(record.parts).to eq([Whois::Record::Part.new(:body => response, :host => "whois.denic.de")])
expect(record.parts).to eq([Whois::Record::Part.new(body: response, host: "whois.denic.de")])
end

context "without format option" do
Expand Down
2 changes: 1 addition & 1 deletion spec/whois/server/adapters/standard_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

record = server.lookup("domain.test")
expect(record.to_s).to eq(expected)
expect(record.parts).to eq([Whois::Record::Part.new(:body => response, :host => "whois.test")])
expect(record.parts).to eq([Whois::Record::Part.new(body: response, host: "whois.test")])
end

context "with port option" do
Expand Down
4 changes: 2 additions & 2 deletions spec/whois/server/adapters/verisign_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
record = server.lookup("example.test")
expect(record.to_s).to eq(expected)
expect(record.parts.size).to eq(1)
expect(record.parts).to eq([Whois::Record::Part.new(:body => response, :host => "whois.test")])
expect(record.parts).to eq([Whois::Record::Part.new(body: response, host: "whois.test")])
end
end

Expand All @@ -31,7 +31,7 @@
record = server.lookup("example.test")
expect(record.to_s).to eq(expected)
expect(record.parts.size).to eq(2)
expect(record.parts).to eq([Whois::Record::Part.new(:body => referral, :host => "whois.test"), Whois::Record::Part.new(:body => response, :host => "whois.markmonitor.com")])
expect(record.parts).to eq([Whois::Record::Part.new(body: referral, host: "whois.test"), Whois::Record::Part.new(body: response, host: "whois.markmonitor.com")])
end

it "extracts the closest referral if multiple referrals" do
Expand Down

0 comments on commit a034215

Please sign in to comment.