dot_hash 1.1.7 → 1.1.8

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: a1b95611ef880619871a9f512c8ade7347246066
4
- data.tar.gz: 649c5672f7b315cd5b340ad72eb9a0a6681970ca
3
+ metadata.gz: 9f89ffdbc4a4c3146b61b402968d4166dfa2b6cd
4
+ data.tar.gz: 5783c2eb2a805c48721569e56f4d69a0b4c0001b
5
5
  SHA512:
6
- metadata.gz: 17e4590a50c2366dd2bc2a24498ab74da204da627d24069012c00250a77c95d1a56939249f2a42f5013ec6d538af9d3838410a0326d112b14c967d6670014eb5
7
- data.tar.gz: d402862159c8f3d265d181a0d8dbfcdd63773239e4b853576120354a14683ae25d7ca6b3b83aade014ec10e461dd713b0ed7abe8f5e28db015b4800e044090de
6
+ metadata.gz: c7a917c54228d409e98110e1c875cfee55101153f8131a49fd4f43aee3c91c044be1baab94a0113ff1bf04fda17384b2b339285f2226facd641777ad9e86a12e
7
+ data.tar.gz: 3dc183862774747dc8096e763fdeed87faaf6173fa697014f87ae33e0df04b9111fd2264bf75d1f11b01aa7725a3b98cea59d8e7b11d74c4eaba624283101453
@@ -2,6 +2,7 @@ module DotHash
2
2
  class Properties
3
3
  attr_reader :hash
4
4
  alias_method :to_hash, :hash
5
+ alias_method :to_h, :hash
5
6
 
6
7
  def initialize(hash)
7
8
  @hash = hash
@@ -1,3 +1,3 @@
1
1
  module DotHash
2
- VERSION = "1.1.7"
2
+ VERSION = "1.1.8"
3
3
  end
@@ -145,13 +145,19 @@ module DotHash
145
145
  end
146
146
  end
147
147
 
148
- describe "#to_hash" do
148
+ describe "#hash" do
149
149
  before do
150
150
  @properties = Properties.new user: { name: "dude" }
151
151
  end
152
152
 
153
- it "returns a hash" do
153
+ it 'matches given hash' do
154
+ assert_equal({user: {name: "dude"}}, properties)
155
+ end
156
+
157
+ it "returns a hash using alias methods" do
158
+ assert_equal properties.hash, user: {name: "dude"}
154
159
  assert_equal properties.to_hash, user: {name: "dude"}
160
+ assert_equal properties.to_h, user: {name: "dude"}
155
161
  end
156
162
  end
157
163
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dot_hash
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcelo Eden
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-13 00:00:00.000000000 Z
11
+ date: 2017-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake