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

Rohan Garg rohangarg-guest at moszumanska.debian.org
Thu Mar 19 16:01:55 UTC 2015


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

The following commit has been merged in the master branch:
commit 66b151b2005678609b1b3a615fc81b93f8a6739d
Author: Rohan Garg <rohan at garg.io>
Date:   Thu Mar 19 17:01:35 2015 +0100

    Add a new method for CaseHash, and add tests for DebianControl
---
 lib/debian/control.rb                              |  5 +++
 .../native => test_debian_control}/debian/control  |  0
 test/test_debian_control.rb                        | 37 ++++++++++++++++++++++
 3 files changed, 42 insertions(+)

diff --git a/lib/debian/control.rb b/lib/debian/control.rb
index 16d0c68..e8fc128 100644
--- a/lib/debian/control.rb
+++ b/lib/debian/control.rb
@@ -6,6 +6,11 @@ class CaseHash < Hash
     def []=(key, value)
         key.respond_to?(:downcase) ? super(key.downcase, value) : super(key, value)
     end
+
+    def key?(key)
+      key.respond_to?(:downcase) ? super(key.downcase) : super(key)
+    end
+
 end
 
 class Relationship
diff --git a/test/data/test_projects/native/debian/control b/test/data/test_debian_control/debian/control
similarity index 100%
copy from test/data/test_projects/native/debian/control
copy to test/data/test_debian_control/debian/control
diff --git a/test/test_debian_control.rb b/test/test_debian_control.rb
new file mode 100644
index 0000000..c735be6
--- /dev/null
+++ b/test/test_debian_control.rb
@@ -0,0 +1,37 @@
+require 'test/unit'
+
+require_relative '../lib/debian/control'
+
+# Test debian/source/format
+class DebianControlFormatTest < Test::Unit::TestCase
+  def setup
+    script_base_path = File.expand_path(File.dirname(__FILE__))
+    script_name = File.basename(__FILE__, '.rb')
+    @datadir = File.join(script_base_path, 'data', script_name)
+    @previous_pwd = Dir.pwd
+    Dir.chdir(@datadir)
+  end
+
+  def teardown
+    Dir.chdir(@previous_pwd)
+  end
+
+  def test_parse
+    assert_nothing_raised do
+      c = DebianControl.new
+      c.parse!
+    end
+  end
+
+  def test_key
+    c = DebianControl.new
+    c.parse!
+    assert_not_nil(c.source.key?('build-depends'))
+  end
+
+  def test_value
+    c = DebianControl.new
+    c.parse!
+    assert_equal(1, c.source['build-depends'].size)
+  end
+end

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list