[DRE-commits] [ruby-fog-json] 08/09: add ruby-minitest as build dep
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 6764c2e0d58f68f641d7fcc3cc5cc546be511306
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date: Sun Apr 20 10:35:22 2014 +0530
add ruby-minitest as build dep
---
debian/control | 2 +-
test/json_decode_test.rb | 15 +++++++++------
test/json_encode_test.rb | 14 ++++++++++----
3 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/debian/control b/debian/control
index fa5bebc..4beab20 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: optional
Maintainer: Debian Ruby Extras Maintainers <pkg-ruby-extras-maintainers at lists.alioth.debian.org>
Uploaders: Pirate Praveen <praveen at debian.org>
Build-Depends: debhelper (>= 7.0.50~), gem2deb (>= 0.7.5~), ruby-multi-json,
- ruby-fog-core
+ ruby-fog-core, ruby-minitest
Standards-Version: 3.9.5
Vcs-Git: git://anonscm.debian.org/pkg-ruby-extras/ruby-fog-json.git
Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-ruby-extras/ruby-fog-json.git;a=summary
diff --git a/test/json_decode_test.rb b/test/json_decode_test.rb
index 5f52ca6..1493c4a 100644
--- a/test/json_decode_test.rb
+++ b/test/json_decode_test.rb
@@ -2,12 +2,15 @@ require "minitest/autorun"
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
diff --git a/test/json_encode_test.rb b/test/json_encode_test.rb
index 7bf6993..e34f4b5 100644
--- a/test/json_encode_test.rb
+++ b/test/json_encode_test.rb
@@ -2,16 +2,22 @@ require "minitest/autorun"
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