[WIP] Allow to operate against multiple Kong API servers#26
Open
[WIP] Allow to operate against multiple Kong API servers#26
Conversation
houndci-bot
reviewed
Feb 16, 2018
|
|
||
| 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.
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.
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.
Space inside { missing.
Space inside } missing.
| base.extend(ClassMethods) | ||
| end | ||
| end | ||
| end No newline at end of file |
| module Kong | ||
| module Rootless | ||
| module ClassMethods | ||
| def find(id, opts={}) |
There was a problem hiding this comment.
Surrounding space missing in default value assignment.
| @klass.respond_to?(method, include_private) | ||
| end | ||
| end | ||
| end No newline at end of file |
| end | ||
|
|
||
| def first(opts={}) | ||
| self.list({},opts).first |
| self.list({ size: 9999999 }, opts) | ||
| end | ||
|
|
||
| def first(opts={}) |
There was a problem hiding this comment.
Surrounding space missing in default value assignment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR will allow user to use
Kong::Clientobjects and operate against multiple Kong API servers.Examples:
The implementation is backward compatible.