Skip to content

Commit 48d1795

Browse files
author
remi Taylor
committed
Fix Cloud Vision specs
1 parent 4f1505f commit 48d1795

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

vision/spec/vision_samples_spec.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,17 @@ def capture &block
3939
# face.png
4040

4141
example "detect labels" do
42-
capture { detect_labels image_path("cat.jpg") }
42+
capture { detect_labels path_to_image_file: image_path("cat.jpg") }
4343

4444
expect(captured_output).to start_with "Image labels:"
4545
expect(captured_output).to include "cat"
4646
expect(captured_output).to include "mammal"
4747
end
4848

4949
example "detect landmark" do
50-
expect { detect_landmark image_path("eiffel_tower.jpg") }.to output(
50+
expect {
51+
detect_landmark path_to_image_file: image_path("eiffel_tower.jpg")
52+
}.to output(
5153
"Found landmark: Eiffel Tower\n"
5254
).to_stdout
5355
end
@@ -57,7 +59,10 @@ def capture &block
5759
expect(File.size output_image_file.path).to eq 0
5860

5961
begin
60-
capture { detect_faces image_path("face.png"), output_image_file.path }
62+
capture do
63+
detect_faces path_to_image_file: image_path("face.png"),
64+
path_to_output_file: output_image_file.path
65+
end
6166

6267
expect(captured_output).to include "Face bounds:"
6368
expect(captured_output).to include "(154, 33)"

vision/vision_samples.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
# TODO: update to use named parameters
15+
# TODO: add variable descriptions
1616

1717
def detect_labels path_to_image_file:
1818
# [START detect_labels]

0 commit comments

Comments
 (0)