[SCM] ci-tooling packaging branch, master, updated. 31603f49bb1a2b54f9555c8043870460d1c5ec9b

Harald Sitter apachelogger-guest at moszumanska.debian.org
Mon Oct 5 12:21:26 UTC 2015


Gitweb-URL: http://git.debian.org/?p=pkg-kde/ci-tooling.git;a=commitdiff;h=b44f9d8

The following commit has been merged in the master branch:
commit b44f9d8b0bfe89cd19a62d15b14d03e995e057fb
Author: Harald Sitter <sitter at kde.org>
Date:   Mon Oct 5 14:02:30 2015 +0200

    use @method_name in testcase if available
    
    this allows us to provision data in setup rather than the tests
---
 test/lib/testcase.rb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/test/lib/testcase.rb b/test/lib/testcase.rb
index 269337e..50c82b2 100644
--- a/test/lib/testcase.rb
+++ b/test/lib/testcase.rb
@@ -43,13 +43,19 @@ class TestCase < Test::Unit::TestCase
     FileUtils.rm_rf(@tmpdir)
   end
 
-  def data(path = nil)
+  def _method_name
+    return @method_name if defined?(:@method_name)
     index = 0
     caller = ''
     until caller.start_with?('test_')
       caller = caller_locations(index, 1)[0].label
       index += 1
     end
+    caller
+  end
+
+  def data(path = nil)
+    caller = _method_name
     file = File.join(*[@datadir, caller, path].compact)
     return file if File.exist?(file)
     fail "Could not find data file #{file}"

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list