File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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)"
Original file line number Diff line number Diff line change 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
1717def detect_labels path_to_image_file :
1818# [START detect_labels]
You can’t perform that action at this time.
0 commit comments