Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Ruby: Allow doc gapic generation to generate tests. #1266

Merged
merged 1 commit into from
May 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ public static List<GapicProvider<? extends Object>> defaultCreate(
providers.add(messageProvider);
}
}
if (generatorConfig.enableTestGenerator() && id.equals(RUBY)) {
if (generatorConfig.enableTestGenerator()) {
GapicCodePathMapper rubyTestPathMapper =
CommonGapicCodePathMapper.newBuilder()
.setPrefix("test")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
============== file: test/library/v1/library_service_smoke_test.rb ==============
# Copyright 2017, Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# AUTO GENERATED BY GAPIC

require "minitest/autorun"
require "minitest/spec"
require "library/v1/library_service_client"

describe "LibraryServiceSmokeTest" do
it "runs one smoke test with update_book" do
unless ENV["SMOKE_TEST_PROJECT"]
fail "Usage: SMOKE_TEST_PROJECT=<project_id> ruby #{$0}"
end
project_id = ENV["SMOKE_TEST_PROJECT"].freeze

Book = Google::Example::Library::V1::Book
FieldMask = Google::Protobuf::FieldMask
LibraryServiceClient = Library::V1::LibraryServiceClient
Rating = Google::Example::Library::V1::Book::Rating
UpdateBookRequest = Google::Example::Library::V1::UpdateBookRequest

library_service_client = LibraryServiceClient.new
formatted_name = LibraryServiceClient.book_path("testShelf-" + Time.new.to_i.to_s, project_id)
rating = Rating::GOOD
book = Book.new(rating: rating)
response = library_service_client.update_book(formatted_name, book)
end
end
Loading