+
+ describe 'with the Pub/Sub API' do
+ before do
+ CLIENT.authorization = nil
+ @pubsub = CLIENT.discovered_api('pubsub', 'v1beta2')
+ end
+
+ it 'should generate requests against the correct URIs' do
+ conn = stub_connection do |stub|
+ stub.get('/v1beta2/projects/12345/topics') do |env|
+ expect(env[:url].host).to eq('pubsub.googleapis.com')
+ [200, {}, '{}']
+ end
+ end
+ request = CLIENT.execute(
+ :api_method => @pubsub.projects.topics.list,
+ :parameters => {'project' => 'projects/12345'},
+ :connection => conn
+ )
+ conn.verify
+ end
+
+ it 'should correctly determine the service root_uri' do
+ expect(@pubsub.root_uri.to_s).to eq('https://pubsub.googleapis.com/')
+ end
+ end