Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add spec for Virtus::ValueObject::InstanceMethods#clone and #dup

  • Loading branch information...
commit ec850e2d802b1ac21bb6c27dc10df6b53464aef9 1 parent 5bbc3af
@dkubb dkubb authored
View
21 spec/unit/virtus/value_object/instance_methods/clone_spec.rb
@@ -0,0 +1,21 @@
+require 'spec_helper'
+
+[ :clone, :dup ].each do |method|
+ describe Virtus::ValueObject::InstanceMethods, "##{method}" do
+ subject { object.send(method) }
+
+ let(:object) { described_class.new }
+
+ let(:described_class) do
+ Class.new do
+ include Virtus::ValueObject
+
+ attribute :name, String
+ end
+ end
+
+ it 'returns the same instance' do
+ should equal(object)
+ end
+ end
+end
View
22 spec/unit/virtus/value_object/instance_methods/duplicates_spec.rb
@@ -1,22 +0,0 @@
-require 'spec_helper'
-
-describe Virtus::ValueObject::InstanceMethods, 'duplication' do
- let(:described_class) do
- Class.new do
- include Virtus::ValueObject
-
- attribute :name, String
- end
- end
-
- subject { described_class.new }
-
- it '#clone returns the same instance' do
- subject.should equal(subject.clone)
- end
-
- it '#dup returns the same instance' do
- subject.should equal(subject.dup)
- end
-
-end
View
5 tasks/metrics/heckle.rake
@@ -45,7 +45,10 @@ begin
end
aliases = Hash.new { |h,mod| h[mod] = Hash.new { |h,method| h[method] = method } }
- map = NameMap.new
+
+ aliases['Virtus::ValueObject::InstanceMethods']['dup'] = 'clone'
+
+ map = NameMap.new
heckle_caught_modules = Hash.new { |hash, key| hash[key] = [] }
unhandled_mutations = 0
Please sign in to comment.
Something went wrong with that request. Please try again.