Skip to content
Browse files

Test suite now works on 1.8.7, 1.9.1 and 1.9.2

  • Loading branch information...
1 parent a80897f commit 069a3429bf965f4ffcc360732c7d99bb8c09c40f @robwilliams robwilliams committed
Showing with 27 additions and 7 deletions.
  1. +1 −0 .gitignore
  2. +12 −3 Rakefile
  3. +4 −1 test/tc_gdata_http_request.rb
  4. +9 −2 test/test_helper.rb
  5. +1 −1 test/ts_gdata.rb
View
1 .gitignore
@@ -0,0 +1 @@
+test/test_config.yml
View
15 Rakefile
@@ -13,8 +13,17 @@
# limitations under the License.
require 'rubygems'
-require 'rake/gempackagetask'
-require 'rake/rdoctask'
+
+if RUBY_VERSION > '1.9.1'
+ require 'rubygems/package_task'
+ require 'rdoc/task'
+elsif RUBY_VERSION > '1.9'
+ require 'rubygems/package_task'
+else
+ require 'rake/gempackagetask'
+ require 'rake/rdoctask'
+end
+
require 'rake/testtask'
task :default => [:test]
@@ -58,7 +67,7 @@ the Google Data APIs.
EOF
end
-Rake::GemPackageTask.new(spec) do |pkg|
+Gem::PackageTask.new(spec) do |pkg|
pkg.need_zip = true
pkg.need_tar = true
end
View
5 test/tc_gdata_http_request.rb
@@ -30,7 +30,10 @@ def test_google_is_live
response = service.make_request(request)
- assert_equal(200, response.status_code)
+ # Google responds with 302 temporary redirect if
+ # client IP address is not in the US
+ # http://www.google.com/support/websearch/bin/answer.py?answer=873
+ assert [200, 302].include?(response.status_code)
end
end
View
11 test/test_helper.rb
@@ -13,8 +13,15 @@
# limitations under the License.
require 'yaml'
-require 'test/unit'
-require 'test/unit/ui/console/testrunner'
+
+# Test::Unit is no longer in standard lib
+if RUBY_VERSION >= '1.9.1'
+ require 'rubygems'
+ require 'test/unit' # gem install test-unit
+else
+ require 'test/unit'
+ require 'test/unit/ui/console/testrunner'
+end
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
require 'gdata'
View
2 test/ts_gdata.rb
@@ -45,4 +45,4 @@ def test_jlength
end
-Test::Unit::UI::Console::TestRunner.run(TS_GData)
+#Test::Unit::UI::Console::TestRunner.run(TS_GData)

0 comments on commit 069a342

Please sign in to comment.
Something went wrong with that request. Please try again.