Update generator to use batchPath instead of hardcoded path
This commit is contained in:
parent
cf38f15a08
commit
687223feb4
|
@ -42,6 +42,7 @@ module Google
|
|||
<% end -%>
|
||||
def initialize
|
||||
super('<%= api.root_url %>', '<%= api.service_path %>')
|
||||
@batch_path = '<%= api.batch_path %>'
|
||||
end
|
||||
<% for api_method in api.all_methods -%>
|
||||
<%= indent(include('method', :api_method => api_method, :api => api), 8) -%>
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
"basePath": "/test/",
|
||||
"rootUrl": "https://www.googleapis.com/",
|
||||
"servicePath": "test/v1/",
|
||||
"batchPath": "batch/test/v1",
|
||||
"rpcPath": "/rpc",
|
||||
"auth": {
|
||||
"oauth2": {
|
||||
|
|
|
@ -30,6 +30,7 @@ RSpec.describe Google::Apis::Generator do
|
|||
puts generator.dump_api_names
|
||||
tempdir = Dir.mktmpdir
|
||||
generated_files.each do |key, content|
|
||||
puts content
|
||||
path = File.join(tempdir, key)
|
||||
FileUtils.mkdir_p(File.dirname(path))
|
||||
File.open(path, 'w') do |f|
|
||||
|
@ -47,6 +48,10 @@ RSpec.describe Google::Apis::Generator do
|
|||
expect(service.root_url.to_s).to eql('https://www.googleapis.com/')
|
||||
end
|
||||
|
||||
it 'should set the batch path' do
|
||||
expect(service.batch_path).to eql('batch/test/v1')
|
||||
end
|
||||
|
||||
it 'should define global methods from discovery' do
|
||||
expect(service.method(:query)).to_not be_nil
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue