-
Notifications
You must be signed in to change notification settings - Fork 34
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
Allow to redefine api_url #6
Conversation
described_class.api_url = nil | ||
expect(described_class.instance.http_client.params).to eq(get_client_new_params) | ||
described_class.api_url = 'http://foo.bar:1337' | ||
expect(described_class.instance.http_client.params).to eq(get_client_new_params) |
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.
Line is too long. [86/80]
|
||
it 'can edit api_url' do | ||
described_class.api_url = nil | ||
expect(described_class.instance.http_client.params).to eq(get_client_new_params) |
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.
Line is too long. [86/80]
path: uri.path, | ||
port: uri.port, | ||
query: uri.query, | ||
scheme: uri.scheme, |
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.
Avoid comma after the last item of a hash.
@@ -23,7 +24,23 @@ | |||
end | |||
|
|||
describe '#api_url' do | |||
|
|||
def get_client_new_params |
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.
Method has too many lines. [11/10]
Do not prefix reader method names with get_.
@@ -23,7 +24,23 @@ | |||
end | |||
|
|||
describe '#api_url' do | |||
|
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.
Extra empty line detected at block body beginning.
end | ||
|
||
def self.api_url=(url) | ||
self.instance.api_url = url | ||
@api_url = url | ||
@http_client = Excon.new(self.api_url, omit_default_port: true) |
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.
Redundant self detected.
My previous PR allowed to set a custom api_url attribute and not use the default one. But it wasn't possible to override this attribute multiple times during execution.
That's what this PR does.