assert_json 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dd24d67064468abc13bf281336e988491e23dbc6
4
- data.tar.gz: d8c713e1c56b76507bc575a0d1ac90a3e3371425
3
+ metadata.gz: 47e249b87ce9a1022cc412b63218ab508bf03a4b
4
+ data.tar.gz: 21e288054b161f68c0b8e1e210933c884ff4fb46
5
5
  SHA512:
6
- metadata.gz: 8c508927745ca239f91b1b6c57c2194a12edfac38774da50e0fe0b3e4e963bd00877b93e34d07b80ff217146a2ee29a523a2fa8e002564817117e21171cd5091
7
- data.tar.gz: bf5db5f5a8e3ed2634bab198db76d2641d09a70b84461f7a98a0c9417c7fb29a6b0af1f3aedf4097d6bdcf575f2fb3ec741a0831e86cf8ddff81027e315e4f8d
6
+ metadata.gz: 2da9d4862e1dd506c97a1fc771c78567372e8a26406b853645720c5a3ecaed7d3ae8869e18e6f6ca2ae1381d5f911d8b5823a9a0f420c84d2ae2da92d7711e52
7
+ data.tar.gz: a1bbdaf6cabe9231008df542248cc6da9a44da6c08fa722fc40e1d0e720a2d6b0013a49f4c4960bf94587fc5aa13ed0180b76ea7b045d4e2e3e3430cca31a67e
@@ -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
@@ -62,7 +62,7 @@ You can also check the size of arrays like this
62
62
 
63
63
  ```ruby
64
64
  assert_json '["value1", "value2"]' do
65
- size 2
65
+ has_length_of 2
66
66
  end
67
67
  ```
68
68
 
@@ -9,8 +9,8 @@ module AssertJson
9
9
  @json.test_for_unexpected_keys('root')
10
10
  end
11
11
 
12
- def size(expected)
13
- @json.size(expected)
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 size(expected)
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}")
@@ -1,4 +1,4 @@
1
1
  # nodoc
2
2
  module AssertJson
3
- VERSION = "0.4.0"
3
+ VERSION = "0.4.1"
4
4
  end
@@ -127,25 +127,25 @@ class AssertJsonNewDslTest < Minitest::Test
127
127
  end
128
128
  end
129
129
 
130
- should "test_array_size" do
130
+ should "test_array_has_length_of" do
131
131
  assert_json '["value1","value2"]' do
132
- size 2
132
+ has_length_of 2
133
133
  end
134
134
  end
135
135
 
136
- should "test_array_size_error" do
136
+ should "test_array_has_length_of_error" do
137
137
  assert_raises(MiniTest::Assertion) do
138
138
  assert_json '["single value"]' do
139
- size 2
139
+ has_length_of 2
140
140
  end
141
141
  end
142
142
  end
143
143
 
144
- should "test_nested_array_size" do
144
+ should "test_nested_array_has_length_of" do
145
145
  assert_json '["value1",["value2.1","value2.2","value3.3"]]' do
146
- size 2
146
+ has_length_of 2
147
147
  item 1 do
148
- size 3
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.0
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-12 00:00:00.000000000 Z
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.6
113
+ rubygems_version: 2.4.5
114
114
  signing_key:
115
115
  specification_version: 4
116
116
  summary: A gem to test JSON strings.