eq_wo_order 0.2.4 → 0.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8c745e416ae194cf358f919b8d45a49cc4195fc2
4
- data.tar.gz: 9fbb9d7568a585c7cd49db4707779a44e3b6a699
3
+ metadata.gz: 94ee46eac4ca9cc090d8f0182cce5b87aa828e9b
4
+ data.tar.gz: bfbf8290a2a3f91f583ddb68e3cf54924636f5ae
5
5
  SHA512:
6
- metadata.gz: 837cc0dcfe1dc23bd417f38d891f7b9c7459cd09e56fc070ada8087b6683759fa72311938bc755079a7c1649fd84743f38b898b07ccc4eae99b7097ac4dc4bdb
7
- data.tar.gz: 83ab48db977a78032493bf706b2f33b114cc1d522aab45b837396a84906bc5430cc5007414b2273109b54f89e4b3943bc5952fd5b9de69b2d9fd07873526507b
6
+ metadata.gz: a0814c2e6216e367eddff70fedfac1e67135c397a3e9824ec6f0fd1c33c14bca99ddc550fda9d5a994f0413b63e14b2cb7cfec20bf002f3a106895c785cb48d9
7
+ data.tar.gz: 4bec73d3241958f98394e3762f4e5cb2f86bf2f70c1f90d2a548523024c91dcf0e1a6ae137da84ec2d1b57226f6dbaad47fdf7fc7ce406f448b4d6869bc5b12d
data/CHANGELOG CHANGED
@@ -5,3 +5,4 @@ Version 0.2.1 Small description update
5
5
  Version 0.2.2 Include CHANGELOG
6
6
  Version 0.2.3 Update description with github link
7
7
  Version 0.2.4 Ruby-ism refactors for terseness
8
+ Version 0.3.0 Support for nil-case
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'eq_wo_order'
3
- s.version = '0.2.4'
3
+ s.version = '0.3.0'
4
4
  s.date = '2016-02-29'
5
5
  s.summary = 'RSpec equality matcher that ignores nested order'
6
6
  s.description = 'RSpec equality matcher that deeply compares array without order - arrays of primitives, hashes, and arrays. Examples at github.com/jadekler/eq_wo_order'
@@ -4,6 +4,8 @@ RSpec::Matchers.define :eq_wo_order do |expected|
4
4
  end
5
5
 
6
6
  def eq_wo_order_base(actual, expected)
7
+ return false unless actual.class == expected.class
8
+
7
9
  case actual
8
10
  when Array
9
11
  primitive_items_match?(actual, expected) &&
@@ -22,6 +22,7 @@ describe '#eq_wo_order' do
22
22
  describe ['a', 'b'] do
23
23
  it { is_expected.to eq_wo_order(['a', 'b']) }
24
24
  it { is_expected.to eq_wo_order(['b', 'a']) }
25
+ it { is_expected.not_to eq_wo_order(nil) }
25
26
  end
26
27
 
27
28
  describe [1, 2] do
@@ -98,6 +99,7 @@ describe '#eq_wo_order' do
98
99
  it { is_expected.to eq_wo_order({a: 'b', c: 'd'}) }
99
100
  it { is_expected.to eq_wo_order({c: 'd', a: 'b'}) }
100
101
  it { is_expected.not_to eq_wo_order({a: 'b', c: 'd', e: 'f'}) }
102
+ it { is_expected.not_to eq_wo_order(nil) }
101
103
  end
102
104
 
103
105
  describe({a: 1, b: 2}) do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eq_wo_order
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean de Klerk