-
Notifications
You must be signed in to change notification settings - Fork 1
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 Twingly::URL#ttld, "true TLD" getter #88
Changes from all commits
0bb2845
585fff0
6f55f91
03d1f92
910373d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,6 +171,17 @@ def valid_urls | |
it { is_expected.to eq("co.uk") } | ||
end | ||
|
||
describe "#ttld" do | ||
subject { url.ttld } | ||
it { is_expected.to eq("uk") } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe me being a 🐔 but I think I'd like a test for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
context "when the TLD is just one level" do | ||
let(:test_url){ "http://twingly.com" } | ||
|
||
it { is_expected.to eq("com") } | ||
end | ||
end | ||
|
||
describe "#domain" do | ||
subject { url.domain } | ||
it { is_expected.to eq("twingly.co.uk") } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a comment why we call it
ttld
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would the comment say? Wouldn't it be better to call the method
true_tld
then?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jage Like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nah, I don't think true is any better. "True" doesn't add any context when to use this.
Yes, that's better.