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

Rohan Garg rohangarg-guest at moszumanska.debian.org
Thu Jul 23 13:49:00 UTC 2015


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

The following commit has been merged in the master branch:
commit fc90d0e8233b3f616443ff40bb70c8011a7cf8de
Author: Rohan Garg <rohan at garg.io>
Date:   Thu Jul 23 15:48:29 2015 +0200

    Refactor test to copy data instead of changing things in the original data
---
 test/test_ci_build_source.rb | 52 +++++++++++++++++++++++---------------------
 1 file changed, 27 insertions(+), 25 deletions(-)

diff --git a/test/test_ci_build_source.rb b/test/test_ci_build_source.rb
index 54c251c..9e8d652 100644
--- a/test/test_ci_build_source.rb
+++ b/test/test_ci_build_source.rb
@@ -23,6 +23,12 @@ class VCSBuilderTest < TestCase
     unalias_time
   end
 
+  # Note: data is a method that resolves the fixture path from the
+  #   calling test_ method name. So we can not set up from setup.
+  def copy_data
+    FileUtils.cp_r(Dir.glob("#{data}/*"), Dir.pwd)
+  end
+
   def alias_time
     CI::BuildVersion.send(:alias_method, :__time_orig, :time)
     CI::BuildVersion.send(:define_method, :time) { REF_TIME }
@@ -37,37 +43,33 @@ class VCSBuilderTest < TestCase
   end
 
   def test_quilt
-    Dir.chdir(data) do
-      s = VcsSourceBuilder.new(release: @release)
-      r = s.run
-      assert_equal(:quilt, r.type)
-      assert_equal('hello', r.name)
-      assert_equal("2.10+git20150717.1756+#{OS::VERSION_ID}-0", r.version)
-    end
+    copy_data
+    s = VcsSourceBuilder.new(release: @release)
+    r = s.run
+    assert_equal(:quilt, r.type)
+    assert_equal('hello', r.name)
+    assert_equal("2.10+git20150717.1756+#{OS::VERSION_ID}-0", r.version)
   end
 
   def test_native
-    Dir.chdir(data) do
-      s = VcsSourceBuilder.new(release: @release)
-      r = s.run
-      assert_equal(:native, r.type)
-      assert_equal('hello', r.name)
-      assert_equal("2.10+git20150717.1756+#{OS::VERSION_ID}", r.version)
-    end
+    copy_data
+    s = VcsSourceBuilder.new(release: @release)
+    r = s.run
+    assert_equal(:native, r.type)
+    assert_equal('hello', r.name)
+    assert_equal("2.10+git20150717.1756+#{OS::VERSION_ID}", r.version)
   end
 
   def test_empty_install
-    Dir.chdir(data) do
-      s = VcsSourceBuilder.new(release: @release)
-      r = s.run
-      assert_equal(:native, r.type)
-      assert_equal('hello', r.name)
-      assert_equal("2.10+git20150717.1756+#{OS::VERSION_ID}", r.version)
-      Dir.chdir('build/') do
-        system("dpkg-source -x #{r.name}_#{r.version}.dsc")
-        assert(File.exist?("#{r.name}-#{r.version}/debian/#{r.name}.lintian-overrides"))
-      end
+    copy_data
+    s = VcsSourceBuilder.new(release: @release)
+    r = s.run
+    assert_equal(:native, r.type)
+    assert_equal('hello', r.name)
+    assert_equal("2.10+git20150717.1756+#{OS::VERSION_ID}", r.version)
+    Dir.chdir('build/') do
+      system("dpkg-source -x #{r.name}_#{r.version}.dsc")
+      assert(File.exist?("#{r.name}-#{r.version}/debian/#{r.name}.lintian-overrides"))
     end
   end
-
 end

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list