Skip to content
This repository has been archived by the owner on Mar 27, 2018. It is now read-only.

Commit

Permalink
Fix: matcher act_as_array performs a deep_dup of the original object …
Browse files Browse the repository at this point in the history
…to test type equality of objects in array.
  • Loading branch information
ihoka committed Nov 1, 2011
1 parent 7285f1c commit 6fe8f76
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ group :development do
gem 'guard-bundler'
end

gem 'yajl-ruby', '>= 0.8.0'
gem 'activesupport', '>= 3.1.1'
gem 'activemodel', '>= 3.1.1'
gem 'money', '>= 3.7.1'
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ GEM
rspec-mocks (2.3.0)
shoulda-matchers (1.0.0.beta3)
thor (0.14.6)
yajl-ruby (1.0.0)
yard (0.7.3)

PLATFORMS
Expand All @@ -62,4 +63,5 @@ DEPENDENCIES
rcov
rspec (~> 2.3.0)
shoulda-matchers (~> 1.0.0.beta3)
yajl-ruby (>= 0.8.0)
yard (>= 0.7.0)
5 changes: 4 additions & 1 deletion hashie-model.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Gem::Specification.new do |s|
s.name = %q{hashie-model}
s.version = "1.0.1"
s.version = "1.1.0"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = [%q{ZenCash.com}]
Expand Down Expand Up @@ -53,6 +53,7 @@ Gem::Specification.new do |s|
s.specification_version = 3

if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<yajl-ruby>, [">= 0.8.0"])
s.add_runtime_dependency(%q<activesupport>, [">= 3.1.1"])
s.add_runtime_dependency(%q<activemodel>, [">= 3.1.1"])
s.add_runtime_dependency(%q<money>, [">= 3.7.1"])
Expand All @@ -69,6 +70,7 @@ Gem::Specification.new do |s|
s.add_development_dependency(%q<guard-yard>, [">= 0"])
s.add_development_dependency(%q<guard-bundler>, [">= 0"])
else
s.add_dependency(%q<yajl-ruby>, [">= 0.8.0"])
s.add_dependency(%q<activesupport>, [">= 3.1.1"])
s.add_dependency(%q<activemodel>, [">= 3.1.1"])
s.add_dependency(%q<money>, [">= 3.7.1"])
Expand All @@ -86,6 +88,7 @@ Gem::Specification.new do |s|
s.add_dependency(%q<guard-bundler>, [">= 0"])
end
else
s.add_dependency(%q<yajl-ruby>, [">= 0.8.0"])
s.add_dependency(%q<activesupport>, [">= 3.1.1"])
s.add_dependency(%q<activemodel>, [">= 3.1.1"])
s.add_dependency(%q<money>, [">= 3.7.1"])
Expand Down
3 changes: 2 additions & 1 deletion lib/hashie_model/spec/matchers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@

RSpec::Matchers.define :act_as_array do |array_klass|
match do |object|
klass = object.class
actual = [object]
expected = array_klass.new([object.as_json])
expected = array_klass.new([object.deep_dup])

actual == expected
end
Expand Down
4 changes: 2 additions & 2 deletions lib/hashie_model/version.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module HashieModel
module Version
MAJOR = 1
MINOR = 0
PATCH = 1
MINOR = 1
PATCH = 0
BUILD = nil

STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
Expand Down

0 comments on commit 6fe8f76

Please sign in to comment.