Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add domain property to RegistroBR parser #77

Merged
merged 5 commits into from
Jun 25, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixing domain property fot RegistroBR when domain available
  • Loading branch information
anacarolinacastro committed Apr 12, 2018
commit e870860a2373bdffad326a36be3de62b08ccd17d
6 changes: 5 additions & 1 deletion lib/whois/parsers/whois.registro.br.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ class WhoisRegistroBr < Base
end

property_supported :domain do
content_for_scanner.match(/^domain: \s*(.+)\n/)[1]
if available?
content_for_scanner.match(/^% No match for \s*(.+)\n/)[1]
elsif registered?
content_for_scanner.match(/^domain: \s*(.+)\n/)[1]
end
end

property_supported :available? do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
#registered?
%s == false

#domain
%s == "u34jedzcq.br"


#created_on
%s == nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
expect(subject.registered?).to eq(false)
end
end
describe "#domain" do
it do
expect(subject.domain).to eq("u34jedzcq.br")
end
end
describe "#created_on" do
it do
expect(subject.created_on).to eq(nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
described_class.new(part)
end

describe "#domain" do
it do
expect(subject.domain).to eq("google.com.br")
end
end
describe "#status" do
it do
expect(subject.status).to eq(:registered)
Expand All @@ -41,6 +36,11 @@
expect(subject.registered?).to eq(true)
end
end
describe "#domain" do
it do
expect(subject.domain).to eq("google.com.br")
end
end
describe "#created_on" do
it do
expect(subject.created_on).to be_a(Time)
Expand Down