deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@apache.org
Subject [1/4] git commit: CIMI Tests: allow running a test with only one of the formats by using :only
Date Tue, 06 Nov 2012 22:37:04 GMT
Updated Branches:
  refs/heads/master 4822d37df -> c4889e4d4


CIMI Tests: allow running a test with only one of the formats by using :only


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/230a1e4f
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/230a1e4f
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/230a1e4f

Branch: refs/heads/master
Commit: 230a1e4f789c2182dcb15a2fc75ea782b369ebfc
Parents: 7492040
Author: David Lutterkort <lutter@redhat.com>
Authored: Fri Nov 2 15:01:48 2012 -0700
Committer: David Lutterkort <lutter@redhat.com>
Committed: Tue Nov 6 14:36:33 2012 -0800

----------------------------------------------------------------------
 tests/cimi/test_helper.rb |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/230a1e4f/tests/cimi/test_helper.rb
----------------------------------------------------------------------
diff --git a/tests/cimi/test_helper.rb b/tests/cimi/test_helper.rb
index f1efaf8..ace3e37 100644
--- a/tests/cimi/test_helper.rb
+++ b/tests/cimi/test_helper.rb
@@ -121,14 +121,21 @@ class CIMI::Test::Spec < MiniTest::Spec
     @content_type = CONTENT_TYPES[fmt]
   end
 
-  def self.it desc = "anonymous", &block
+  def self.it desc = "anonymous", opts = {}, &block
     block ||= proc { skip "(no tests defined)" }
 
-    CONTENT_TYPES.keys.each do |fmt|
-      super("#{desc} [#{fmt}]") do
-        use_format(fmt)
+    if opts[:only]
+      super("#{desc}") do
+        use_format(opts[:only])
         instance_eval &block
       end
+    else
+      CONTENT_TYPES.keys.each do |fmt|
+        super("#{desc} [#{fmt}]") do
+          use_format(fmt)
+          instance_eval &block
+        end
+      end
     end
   end
 


Mime
View raw message