spyke 3.0.0 → 3.1.0

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: 2ce71952fe595064f132a92bbbc41179614be927
4
- data.tar.gz: bdf0fc8ed096c28303c3014ddcb588a666a39a04
3
+ metadata.gz: b13b696560677d38ecf376de766cf815d004ea84
4
+ data.tar.gz: 50618def09e1ea933d813361baea87342f676a8c
5
5
  SHA512:
6
- metadata.gz: 8799dbc60fb64c096241990fb35d53d802dcc83c98a45f71e1573649261b3b11ea8558af102e335ed7eabde7678056bc13912984de7a7e51665d75be9cae6f82
7
- data.tar.gz: df55a3f1dc825c5a10d3e0c142b42bed0739cb942e8c32bc2da501a9215f897200fa3fd6a162cdcebb19241369868fafd802dd7ab5349f9f0a858e2d0b63fc1f
6
+ metadata.gz: 575f175c00c78820d6c7f6178522054f8fb0ccf32a8898cac4c776ec715dd68a69572de1ccf329c8f33df2b76d54c095c9c754edb320c7fa72b843ae5803d86c
7
+ data.tar.gz: 010b22f6c54164d2d142ec1d83dcd5567f1153f86ae02f739609b6d160c5c55eacb6628c1ce64c3a6215a326e330d8f4e6578da6ccb8a5216de2c80314a2fccb
@@ -7,6 +7,7 @@ module Spyke
7
7
 
8
8
  included do
9
9
  attr_reader :attributes
10
+ delegate :[], :[]=, to: :attributes
10
11
  end
11
12
 
12
13
  module ClassMethods
@@ -1,3 +1,3 @@
1
1
  module Spyke
2
- VERSION = '3.0.0'
2
+ VERSION = '3.1.0'
3
3
  end
@@ -59,6 +59,19 @@ module Spyke
59
59
  assert_equal 'Sushi', recipe.title
60
60
  end
61
61
 
62
+ def test_attributes_element_reference
63
+ recipe = Recipe.new(title: 'Chicken Soup')
64
+
65
+ assert_equal 'Chicken Soup', recipe[:title]
66
+ end
67
+
68
+ def test_attributes_element_assignment
69
+ recipe = Recipe.new
70
+ recipe[:title] = 'Beef Brisket'
71
+
72
+ assert_equal 'Beef Brisket', recipe.title
73
+ end
74
+
62
75
  def test_equality
63
76
  assert_equal Recipe.new(id: 2, title: 'Fish'), Recipe.new(id: 2, title: 'Fish')
64
77
  refute_equal Recipe.new(id: 2, title: 'Fish'), Recipe.new(id: 1, title: 'Fish')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spyke
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Balvig
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-14 00:00:00.000000000 Z
11
+ date: 2015-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport