assert_json 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/lib/assert_json/assert_json.rb +3 -3
- data/lib/assert_json/version.rb +1 -1
- data/test/assert_json_new_dsl_test.rb +7 -7
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47e249b87ce9a1022cc412b63218ab508bf03a4b
|
4
|
+
data.tar.gz: 21e288054b161f68c0b8e1e210933c884ff4fb46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2da9d4862e1dd506c97a1fc771c78567372e8a26406b853645720c5a3ecaed7d3ae8869e18e6f6ca2ae1381d5f911d8b5823a9a0f420c84d2ae2da92d7711e52
|
7
|
+
data.tar.gz: a1bbdaf6cabe9231008df542248cc6da9a44da6c08fa722fc40e1d0e720a2d6b0013a49f4c4960bf94587fc5aa13ed0180b76ea7b045d4e2e3e3430cca31a67e
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 0.4.1
|
4
|
+
|
5
|
+
* remove conflicts with test/unit (see [issue 10](https://github.com/alto/assert_json/issues/10) for details, thanks to [@thomasjachmann](https://github.com/thomasjachmann), for [fixing this](https://github.com/alto/assert_json/pull/11))
|
6
|
+
|
3
7
|
## 0.4.0
|
4
8
|
|
5
9
|
* add support for `size` (to test the size of arrays and hashes) (thanks to [@thomasjachmann](https://github.com/thomasjachmann), see [pull request 9](https://github.com/alto/assert_json/pull/9))
|
data/README.md
CHANGED
@@ -9,8 +9,8 @@ module AssertJson
|
|
9
9
|
@json.test_for_unexpected_keys('root')
|
10
10
|
end
|
11
11
|
|
12
|
-
def
|
13
|
-
@json.
|
12
|
+
def has_length_of(expected)
|
13
|
+
@json.has_length_of(expected)
|
14
14
|
end
|
15
15
|
|
16
16
|
def item(index, &block)
|
@@ -39,7 +39,7 @@ module AssertJson
|
|
39
39
|
@only = false
|
40
40
|
end
|
41
41
|
|
42
|
-
def
|
42
|
+
def has_length_of(expected)
|
43
43
|
raise_error("element #{@decoded_json.inspect} is not sizable") unless @decoded_json.respond_to?(:size)
|
44
44
|
return if @decoded_json.size == expected
|
45
45
|
raise_error("element #{@decoded_json.inspect} has #{@decoded_json.size} items, expected #{expected}")
|
data/lib/assert_json/version.rb
CHANGED
@@ -127,25 +127,25 @@ class AssertJsonNewDslTest < Minitest::Test
|
|
127
127
|
end
|
128
128
|
end
|
129
129
|
|
130
|
-
should "
|
130
|
+
should "test_array_has_length_of" do
|
131
131
|
assert_json '["value1","value2"]' do
|
132
|
-
|
132
|
+
has_length_of 2
|
133
133
|
end
|
134
134
|
end
|
135
135
|
|
136
|
-
should "
|
136
|
+
should "test_array_has_length_of_error" do
|
137
137
|
assert_raises(MiniTest::Assertion) do
|
138
138
|
assert_json '["single value"]' do
|
139
|
-
|
139
|
+
has_length_of 2
|
140
140
|
end
|
141
141
|
end
|
142
142
|
end
|
143
143
|
|
144
|
-
should "
|
144
|
+
should "test_nested_array_has_length_of" do
|
145
145
|
assert_json '["value1",["value2.1","value2.2","value3.3"]]' do
|
146
|
-
|
146
|
+
has_length_of 2
|
147
147
|
item 1 do
|
148
|
-
|
148
|
+
has_length_of 3
|
149
149
|
end
|
150
150
|
end
|
151
151
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: assert_json
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thorsten Böttger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
110
|
version: '0'
|
111
111
|
requirements: []
|
112
112
|
rubyforge_project:
|
113
|
-
rubygems_version: 2.4.
|
113
|
+
rubygems_version: 2.4.5
|
114
114
|
signing_key:
|
115
115
|
specification_version: 4
|
116
116
|
summary: A gem to test JSON strings.
|