-
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
[WIP] Allow to operate against multiple Kong API servers #26
base: master
Are you sure you want to change the base?
Conversation
|
||
it 'uses given Collection instance' do | ||
consumer_collection = Kong::Collection.new(Kong::Consumer, Kong::Client.new('http://kong-api:8001')) | ||
instance = Klass.new({}, {collection: consumer_collection}) |
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.
Space inside { missing.
Space inside } missing.
|
||
context 'with opts' do | ||
it 'uses given Client instance' do | ||
instance = Klass.new({}, {client: Kong::Client.new('http://kong-api:8001')}) |
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.
Space inside { missing.
Space inside } missing.
it 'is alias of .list' do | ||
expect(Klass.method(:list)).to eq(Klass.method(:all)) | ||
it 'calls .list with size option' do | ||
expect(Kong::Client.instance).to receive(:get).with('/resources/', {size: 9999999}).and_return({ data: [] }) |
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.
Space inside { missing.
Space inside } missing.
base.extend(ClassMethods) | ||
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.
Final newline missing.
module Kong | ||
module Rootless | ||
module ClassMethods | ||
def find(id, opts={}) |
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.
Surrounding space missing in default value assignment.
@klass.respond_to?(method, include_private) | ||
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.
Final newline missing.
end | ||
|
||
def first(opts={}) | ||
self.list({},opts).first |
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.
Space missing after comma.
self.list({ size: 9999999 }, opts) | ||
end | ||
|
||
def first(opts={}) |
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.
Surrounding space missing in default value assignment.
This PR will allow user to use
Kong::Client
objects and operate against multiple Kong API servers.Examples:
The implementation is backward compatible.