[DRE-commits] [kwalify] 02/03: [patch] fixed tmpdir creation and added missing cleanup

Marc Dequènes duck at moszumanska.debian.org
Wed Aug 5 01:01:12 UTC 2015


This is an automated email from the git hooks/post-receive script.

duck pushed a commit to branch master
in repository kwalify.

commit 2e6c35e56e0972fd3a9aeb08a105af0f1a337fe6
Author: Marc Dequènes (Duck) <Duck at DuckCorp.org>
Date:   Wed Aug 5 01:24:25 2015 +0200

    [patch] fixed tmpdir creation and added missing cleanup
---
 debian/changelog                     |  1 +
 debian/patches/series                |  1 +
 debian/patches/test_fix_tmpdir.patch | 64 ++++++++++++++++++++++++++++++++++++
 3 files changed, 66 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 1234d78..e61f9c7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,7 @@ kwalify (0.7.2-3) UNRELEASED; urgency=medium
   * Added patch to remove broken test data.
   * Added patch to fix string conversion into array of lines.
   * Added patch to fix several path problems in tests.
+  * Added patch to fix tests temporary directory creation and cleanup.
 
  -- Marc Dequènes (Duck) <Duck at DuckCorp.org>  Tue, 04 Aug 2015 21:33:19 +0200
 
diff --git a/debian/patches/series b/debian/patches/series
index 2b980c7..3932ee0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@ test-metavalidator_hash_manip_fix.patch
 broken_test_documents_removal.patch
 proper_string_split.patch
 test_paths_fix.patch
+test_fix_tmpdir.patch
diff --git a/debian/patches/test_fix_tmpdir.patch b/debian/patches/test_fix_tmpdir.patch
new file mode 100644
index 0000000..1eb7172
--- /dev/null
+++ b/debian/patches/test_fix_tmpdir.patch
@@ -0,0 +1,64 @@
+Index: kwalify/test/test-action.rb
+===================================================================
+--- kwalify.orig/test/test-action.rb
++++ kwalify/test/test-action.rb
+@@ -7,6 +7,7 @@
+ require File.dirname(__FILE__) + '/test.rb'
+ 
+ require 'kwalify/main'
++require 'fileutils'
+ 
+ 
+ module Kwalify
+@@ -30,9 +31,16 @@ class ActionTest < Test::Unit::TestCase
+   load_yaml_testdata(filename, :lang=>'ruby')
+ 
+ 
+-  ## temporary directory
+-  @@tmpdir = "tmp.dir"
+-  Dir.mkdir(@@tmpdir) unless test(?d, @@tmpdir)
++  def setup
++    ## temporary directory
++    @@tmpdir = "tmp.dir"
++    Dir.mkdir(@@tmpdir) unless test(?d, @@tmpdir)
++  end
++
++
++  def teardown
++    FileUtils.rm_rf(@@tmpdir, :secure => true)
++  end
+ 
+ 
+   def _test
+Index: kwalify/test/test-main.rb
+===================================================================
+--- kwalify.orig/test/test-main.rb
++++ kwalify/test/test-main.rb
+@@ -7,6 +7,7 @@
+ require File.dirname(__FILE__) + '/test.rb'
+ 
+ require 'kwalify/main'
++require 'fileutils'
+ 
+ 
+ module Kwalify
+@@ -30,9 +31,16 @@ class MainTest < Test::Unit::TestCase
+   load_yaml_testdata(filename, :lang=>'ruby')
+ 
+ 
+-  ## temporary directory
+-  @@tmpdir = "tmp.dir"
+-  Dir.mkdir(@@tmpdir) unless test(?d, @@tmpdir)
++  def setup
++    ## temporary directory
++    @@tmpdir = "tmp.dir"
++    Dir.mkdir(@@tmpdir) unless test(?d, @@tmpdir)
++  end
++
++
++  def teardown
++    FileUtils.rm_rf(@@tmpdir, :secure => true)
++  end
+ 
+ 
+   def _test

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/kwalify.git



More information about the Pkg-ruby-extras-commits mailing list