File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -542,10 +542,9 @@ def generate_request(options={})
542542 #
543543 # @see Google::APIClient#generate_request
544544 def execute ( *params )
545- if params . last . kind_of? ( Google ::APIClient ::Request ) &&
546- params . size == 1
547- request = params . pop
548- options = { }
545+ if params . first . kind_of? ( Google ::APIClient ::Request )
546+ request = params . shift
547+ options = params . shift || { }
549548 else
550549 # This block of code allows us to accept multiple parameter passing
551550 # styles, and maintaining some backwards compatibility.
Original file line number Diff line number Diff line change 143143 )
144144 end
145145
146+ it 'should accept options with batch/request style execute' do
147+ client . authorization . access_token = "abcdef"
148+ new_auth = Signet ::OAuth2 ::Client . new ( :access_token => '12345' )
149+ request = client . generate_request (
150+ :api_method => @prediction . training . insert ,
151+ :parameters => { 'data' => '12345' }
152+ )
153+ client . execute (
154+ request ,
155+ :authorization => new_auth ,
156+ :connection => @connection
157+ )
158+ end
159+
160+
146161 it 'should accept options in array style execute' do
147162 client . authorization . access_token = "abcdef"
148163 new_auth = Signet ::OAuth2 ::Client . new ( :access_token => '12345' )
You can’t perform that action at this time.
0 commit comments