named_struct 0.0.1 → 0.0.2

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: d9f07fc08fe47b747577f6c1f2a080295b437cc6
4
- data.tar.gz: 380ce889316a7387b33c340279f5d81b7f052d20
3
+ metadata.gz: 48a1c595feb14871618253053d7be409dd0eb203
4
+ data.tar.gz: 32098978ee3853722724ff27eac4d3c664b5636d
5
5
  SHA512:
6
- metadata.gz: 4008bbc5004c1351c88911570f423f992e1ff640a43fed8dc5564e7d5f3e849177b539cb22c7d3ba6a5ce7cec0b24951207070fac141a921d09933d169f7c18b
7
- data.tar.gz: 8b24d41151be98eae8f3d48024f518147406f77911853d55f9c1926927b8dbb7d7c7c9ad3190417c82d6c93afc9138d25a4b18ada0833533ae68efdc73c32652
6
+ metadata.gz: 435a06f747429496c60ebfe63fef4e991967cbc08ef708427c7402efa424467b514bc329cb76a54529676f35a91221341cc9571596ef600b49439fd5ea314fee
7
+ data.tar.gz: 9acd5fc0edbf0f002430b6aa8e3dbc6a792d9d01d7230bedf9be9d484654a60fdec4f221a0040ff1c52e84429c5f7dc4a7ef7841be435e2c8a7beef7f5e896b6
@@ -19,7 +19,7 @@ module NamedStruct
19
19
  end
20
20
  keys = args.keys
21
21
  required_keys = self.class.members
22
- if keys != required_keys
22
+ if keys.sort != required_keys.sort
23
23
  if keys.size > required_keys.size
24
24
  raise(ArgumentError, "wrong number of arguments (%d for %d)"%
25
25
  [keys.size, required_keys.size])
@@ -1,3 +1,3 @@
1
1
  module NamedStruct
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -45,6 +45,13 @@ RSpec.describe NamedStruct::Config do
45
45
  end
46
46
 
47
47
  context "with keyword arguments" do
48
+ context "with all required arguments (random order)" do
49
+ subject{ MyConfig.new(b: 10, a: 11)}
50
+ it { is_expected.to be_kind_of(MyConfig) }
51
+ it { expect{ subject }.to_not raise_error }
52
+ it { expect(subject.a).to eq(11) }
53
+ it { expect(subject.b).to eq(10) }
54
+ end
48
55
  context "with all required arguments" do
49
56
  subject{ MyConfig.new(a: 10, b: 11)}
50
57
  it { is_expected.to be_kind_of(MyConfig) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: named_struct
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Shytikov