From 139302fd5ecc9e4d4b39f99c99ccbf2f51e0a78d Mon Sep 17 00:00:00 2001 From: "mattpok@google.com" Date: Wed, 18 Aug 2010 22:18:21 +0000 Subject: [PATCH] added basic rspec for transport and fix imports in transport class git-svn-id: https://google-api-ruby-client.googlecode.com/svn/trunk@19 c1d61fac-ed7f-fcc1-18f7-ff78120a04ef --- .../api_client/transport/http_transport.rb | 2 ++ .../transport/http_transport_spec.rb | 29 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 spec/google/api_client/transport/http_transport_spec.rb diff --git a/lib/google/api_client/transport/http_transport.rb b/lib/google/api_client/transport/http_transport.rb index 8293d54a2..270ce52b3 100644 --- a/lib/google/api_client/transport/http_transport.rb +++ b/lib/google/api_client/transport/http_transport.rb @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +require 'google/api_client/parser/json_parser' + module Google #:nodoc: class APIClient #:nodoc: ## diff --git a/spec/google/api_client/transport/http_transport_spec.rb b/spec/google/api_client/transport/http_transport_spec.rb new file mode 100644 index 000000000..2725a2306 --- /dev/null +++ b/spec/google/api_client/transport/http_transport_spec.rb @@ -0,0 +1,29 @@ +# Copyright 2010 Google Inc. +# +# 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. + +require 'spec_helper' + +require 'google/api_client/transport/http_transport' +require 'google/api_client/parser/json_parser' + +describe Google::APIClient::HTTPTransport, 'with default configuration' do + before do + @transport = Google::APIClient::HTTPTransport.new + @parser = Google::APIClient::JSONParser.new + end + + it 'should use the default json parser' do + @transport.parser.should be_instance_of Google::APIClient::JSONParser + end +end