spec/grape/util/inheritable_values_spec.rb in grape-0.12.0 vs spec/grape/util/inheritable_values_spec.rb in grape-0.13.0
- old
+ new
@@ -56,8 +56,22 @@
parent[:some_thing] = :foo
subject[:some_thing_more] = :foo_bar
expect(subject.to_hash).to eq(some_thing: :foo, some_thing_more: :foo_bar)
end
end
+
+ describe '#clone' do
+ let(:obj_cloned) { subject.clone }
+
+ context 'complex (i.e. not primitive) data types (ex. entity classes, please see bug #891)' do
+ let(:description) { { entity: double } }
+
+ before { subject[:description] = description }
+
+ it 'copies values; does not duplicate them' do
+ expect(obj_cloned[:description]).to eq description
+ end
+ end
+ end
end
end
end