hash_dealer 1.3.2 → 1.3.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.2
1
+ 1.3.3
data/hash_dealer.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{hash_dealer}
8
- s.version = "1.3.2"
8
+ s.version = "1.3.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Dan Langevin"]
12
- s.date = %q{2011-09-05}
12
+ s.date = %q{2011-09-06}
13
13
  s.description = %q{Like Factory Girl but for Hashes only}
14
14
  s.email = %q{dan.langevin@lifebooker.com}
15
15
  s.extra_rdoc_files = [
@@ -104,8 +104,9 @@ class Array
104
104
  end
105
105
  # call matcher on all of the elements
106
106
  def matcher(opts = {})
107
- self.unshift(":matcher")
108
- VariableArray.new(self.collect(&:matcher))
107
+ klone = self.clone
108
+ klone.unshift(":matcher")
109
+ VariableArray.new(klone.collect(&:matcher))
109
110
  end
110
111
  # we want this to apply to both :eql? and ==
111
112
  alias_method :eql?, :==
@@ -113,6 +113,14 @@ describe HashDealer do
113
113
 
114
114
  end
115
115
 
116
+ it "should not modify the element when returning a matcher" do
117
+ HashDealer.define(:array) do
118
+ my_array([1,2,3])
119
+ end
120
+ HashDealer.roll(:array).matcher[:my_array].should eql ([":matcher",1,2,3])
121
+ HashDealer.roll(:array)[:my_array].should eql ([1,2,3])
122
+ end
123
+
116
124
  end
117
125
 
118
126
  it "should apply except/only to nested values if they are defined by hash dealer and specified" do
@@ -180,4 +188,6 @@ describe HashDealer do
180
188
  HashDealer.roll(:b).should eql({:hash_a => {:a => "123"}})
181
189
  end
182
190
 
191
+
192
+
183
193
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: hash_dealer
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.3.2
5
+ version: 1.3.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Dan Langevin
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-09-05 00:00:00 Z
13
+ date: 2011-09-06 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -141,7 +141,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
141
141
  requirements:
142
142
  - - ">="
143
143
  - !ruby/object:Gem::Version
144
- hash: 538716834169318373
144
+ hash: -463454220033968617
145
145
  segments:
146
146
  - 0
147
147
  version: "0"