-
Notifications
You must be signed in to change notification settings - Fork 0
Fix eBay API initialization with site parameter #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
Changes from all commits
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 | ||
|---|---|---|---|---|
|
|
@@ -73,4 +73,47 @@ | |||
| expect(subject).to eq "Canadian" | ||||
| end | ||||
| end | ||||
|
|
||||
| describe ".new" do | ||||
|
Owner
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. To make the test actually checking whether everything is loaded correctly it's needed to remove Line 22 in d255b7d
Collaborator
Author
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. good spot! thanks |
||||
| context "when initialized with a hash argument" do | ||||
| let(:hash_attrs) do | ||||
| { | ||||
| id: 0, | ||||
| code: "EBAY-US", | ||||
| country: "US", | ||||
| host: "www.ebay.com", | ||||
| key: "EBAY_US", | ||||
| currencies: ["USD"], | ||||
| languages: ["en-US"] | ||||
ulandj marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
| } | ||||
| end | ||||
|
|
||||
| it "properly initializes attributes from hash" do | ||||
| site = described_class.new(hash_attrs) | ||||
| expect(site.id).to eq(0) | ||||
| expect(site.code).to eq("EBAY-US") | ||||
| expect(site.country).to eq("US") | ||||
| expect(site.host).to eq("www.ebay.com") | ||||
| expect(site.key).to eq("EBAY_US") | ||||
| expect(site.currencies.first.code).to eq("USD") | ||||
| expect(site.languages.first).to eq("en-US") | ||||
| end | ||||
| end | ||||
|
|
||||
| context "when initialized with keyword arguments" do | ||||
| it "properly initializes attributes from keywords" do | ||||
| site = described_class.new( | ||||
| id: 0, | ||||
| code: "EBAY-US", | ||||
| country: "US", | ||||
| host: "www.ebay.com", | ||||
| key: "EBAY_US" | ||||
| ) | ||||
| expect(site.id).to eq(0) | ||||
| expect(site.code).to eq("EBAY-US") | ||||
| expect(site.country).to eq("US") | ||||
ulandj marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
| expect(site.host).to eq("www.ebay.com") | ||||
| end | ||||
| end | ||||
| end | ||||
| end | ||||
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.
Is it really necessary to support two ways of initialization? Wdyt about keeping only one, which would be easier to maintain?
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.
I want to avoid affecting other parts. As you mentioned, the fork is far behind the upstream version, and I prefer not to investigate or apply fixes if we plan to rebase onto the original gem.