File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 2121
2222# Instantiates a client
2323gcloud = Google ::Cloud . new project_id
24- language_client = gcloud . language
24+ language = gcloud . language
2525
2626# The text to analyze
2727text = "Hello, world!"
28- document = language_client . document text
28+ document = language . document text
2929
3030# Detects the sentiment of the text
3131sentiment = document . sentiment
Original file line number Diff line number Diff line change 1- #!/usr/bin/ruby
21# Copyright 2016 Google, Inc
32#
43# Licensed under the Apache License, Version 2.0 (the "License");
1918describe "Language Quickstart" do
2019
2120 it "detect sentiment" do
22- gcloud_test_client = Google ::Cloud . new ENV [ "GOOGLE_CLOUD_PROJECT" ]
21+ gcloud = Google ::Cloud . new ENV [ "GOOGLE_CLOUD_PROJECT" ]
2322 expect ( Google ::Cloud ) . to receive ( :new ) . with ( "YOUR_PROJECT_ID" ) .
24- and_return ( gcloud_test_client )
23+ and_return ( gcloud )
2524
2625 expect {
2726 load File . expand_path ( "../quickstart.rb" , __dir__ )
You can’t perform that action at this time.
0 commit comments