From 3cfb74235885faa268e4984962e36f7254478104 Mon Sep 17 00:00:00 2001
From: Patrick J Cherry <patrick@bytemark.co.uk>
Date: Wed, 10 Feb 2016 10:45:07 +0000
Subject: Updated tests to use 'omit' when available

The redis and rubocop tests now skip on ruby > 2.0 (I think)
---
 t/test-custodian-queue.rb | 8 ++++++++
 t/test-rubocop.rb         | 6 +++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/t/test-custodian-queue.rb b/t/test-custodian-queue.rb
index d9145c8..c25fc24 100755
--- a/t/test-custodian-queue.rb
+++ b/t/test-custodian-queue.rb
@@ -19,6 +19,13 @@ class TestCustodianQueue < Test::Unit::TestCase
   # Create the test suite environment: NOP.
   #
   def setup
+    unless defined? ::Redis
+      if methods.include? :skip
+        skip("Redis library missing -- skipping tests")
+      else
+        omit("Redis library missing -- skipping tests")
+      end
+    end
   end
 
 
@@ -35,6 +42,7 @@ class TestCustodianQueue < Test::Unit::TestCase
   #  Test we can create and use a Redis queue.
   #
   def test_redis
+
     q = nil
     assert_nothing_raised do
       q = Custodian::RedisQueueType.new()
diff --git a/t/test-rubocop.rb b/t/test-rubocop.rb
index f4a7612..57457b7 100755
--- a/t/test-rubocop.rb
+++ b/t/test-rubocop.rb
@@ -23,7 +23,11 @@ class TestRubocop < Test::Unit::TestCase
       assert(result == 0, 'No errors found')
 
     rescue LoadError => ex
-      skip("Failed to load 'rubocop' gem - skipping")
+      if methods.include?(:skip)
+        skip("Failed to load 'rubocop' gem - skipping")
+      else
+        omit("Failed to load 'rubocop' gem - skipping")
+      end
     end
   end
 
-- 
cgit v1.2.3