[DRE-commits] [ruby-fog-json] 05/09: skip encoding test, patch from upstream

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Sun Apr 20 06:22:49 UTC 2014


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

praveen pushed a commit to branch master
in repository ruby-fog-json.

commit 63d0f1fb95ab40881fb3240b0de246f3f5504639
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date:   Sun Apr 20 10:28:30 2014 +0530

    skip encoding test, patch from upstream
---
 debian/patches/series                   |  1 +
 debian/patches/skip-encoding-test.patch | 58 +++++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+)

diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..c846791
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+skip-encoding-test.patch
diff --git a/debian/patches/skip-encoding-test.patch b/debian/patches/skip-encoding-test.patch
new file mode 100644
index 0000000..8ac12ae
--- /dev/null
+++ b/debian/patches/skip-encoding-test.patch
@@ -0,0 +1,58 @@
+Description: skip encoding tests
+ due to incompatibilities with ruby versions
+Forwarded: yes
+Bug-Upstream: https://github.com/fog/fog-json/issues/3
+
+--- a/test/json_decode_test.rb
++++ b/test/json_decode_test.rb
+@@ -2,12 +2,15 @@
+ require "fog/json"
+ 
+ class TestJSONDecoding < Minitest::Test
+-  def test_decode_with_valid_string
+-    @json = %q{{"key":"value", "array": ["one", "two", "three"]}}
+-    @expected = {
+-      "key" => "value",
+-      "array" => %W(one two three)
+-    }
++  def test_decode_array
++    @json = %q{["one", "two", "three"]}
++    @expected = %w(one two three)
++    assert_equal @expected, Fog::JSON.decode(@json)
++  end
++
++  def test_decode_hash
++    @json = %q{{"key":"value"}}
++    @expected = { "key" => "value" }
+     assert_equal @expected, Fog::JSON.decode(@json)
+   end
+ 
+--- a/test/json_encode_test.rb
++++ b/test/json_encode_test.rb
+@@ -2,16 +2,22 @@
+ require "fog/json"
+ 
+ class TestJSONEncoding < Minitest::Test
+-  def test_encode_with_valid_hash
++  def test_encode_array
++    @array = %W(one two three)
++    @expected = %q{["one","two","three"]}
++    assert_equal @expected, Fog::JSON.encode(@array)
++  end
++
++  def test_encode_hash
+     @hash = {
+-      "key" => "value",
+-      "array" => %W(one two three)
++      "key" => "value"
+     }
+-    @expected = %q{{"key":"value","array":["one","two","three"]}}
++    @expected = %q{{"key":"value"}}
+     assert_equal @expected, Fog::JSON.encode(@hash)
+   end
+ 
+   def test_encode_with_bad_input
++    skip if %w(1.8.7 2.0.0).include?(RUBY_VERSION)
+     assert_raises(Fog::JSON::EncodeError) { Fog::JSON.encode("\x82\xAC\xEF") }
+   end
+ end

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



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