djsun-mongo_mapper 0.5.6.2 → 0.5.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/djsun-mongo_mapper.gemspec +1 -1
- data/lib/mongo_mapper/embedded_document.rb +1 -0
- data/test/unit/test_document.rb +17 -3
- data/test/unit/test_embedded_document.rb +16 -2
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.6.
|
1
|
+
0.5.6.3
|
data/djsun-mongo_mapper.gemspec
CHANGED
data/test/unit/test_document.rb
CHANGED
@@ -173,8 +173,15 @@ class DocumentTest < Test::Unit::TestCase
|
|
173
173
|
doc_2 = @document.new('name' => "Doc 2")
|
174
174
|
doc_1.should_not == doc_2
|
175
175
|
end
|
176
|
+
|
177
|
+
should "not be == when comparing other object types" do
|
178
|
+
doc = @document.new('name' => "Doc")
|
179
|
+
doc.should_not == nil
|
180
|
+
doc.should_not == false
|
181
|
+
doc.should_not == { 'name' => "Doc" }
|
182
|
+
end
|
176
183
|
|
177
|
-
should "not care about type" do
|
184
|
+
should "not care about document type" do
|
178
185
|
@person = Class.new do
|
179
186
|
include MongoMapper::EmbeddedDocument
|
180
187
|
|
@@ -195,13 +202,20 @@ class DocumentTest < Test::Unit::TestCase
|
|
195
202
|
doc_1.should eql?(doc_2)
|
196
203
|
end
|
197
204
|
|
198
|
-
should "not be
|
205
|
+
should "not be eql? if type matches but key values are different" do
|
199
206
|
doc_1 = @document.new('name' => "Doc 1")
|
200
207
|
doc_2 = @document.new('name' => "Doc 2")
|
201
208
|
doc_1.should_not eql?(doc_2)
|
202
209
|
end
|
203
210
|
|
204
|
-
should "not be eql?
|
211
|
+
should "not be eql? when comparing other object types" do
|
212
|
+
doc = @document.new('name' => "Doc")
|
213
|
+
doc.should_not eql?(nil)
|
214
|
+
doc.should_not eql?(false)
|
215
|
+
doc.should_not eql?({ 'name' => "Doc" })
|
216
|
+
end
|
217
|
+
|
218
|
+
should "not be eql? if document types are different even if values are the same" do
|
205
219
|
@person = Class.new do
|
206
220
|
include MongoMapper::EmbeddedDocument
|
207
221
|
|
@@ -657,7 +657,14 @@ class EmbeddedDocumentTest < Test::Unit::TestCase
|
|
657
657
|
doc_1.should_not == doc_2
|
658
658
|
end
|
659
659
|
|
660
|
-
should "not
|
660
|
+
should "not be == when comparing other object types" do
|
661
|
+
doc = @document.new('name' => "Doc")
|
662
|
+
doc.should_not == nil
|
663
|
+
doc.should_not == false
|
664
|
+
doc.should_not == { 'name' => "Doc" }
|
665
|
+
end
|
666
|
+
|
667
|
+
should "not care about document type" do
|
661
668
|
@person = Class.new do
|
662
669
|
include MongoMapper::EmbeddedDocument
|
663
670
|
|
@@ -678,12 +685,19 @@ class EmbeddedDocumentTest < Test::Unit::TestCase
|
|
678
685
|
doc_1.should eql?(doc_2)
|
679
686
|
end
|
680
687
|
|
681
|
-
should "not be
|
688
|
+
should "not be eql? if type matches but key values are different" do
|
682
689
|
doc_1 = @document.new('name' => "Doc 1")
|
683
690
|
doc_2 = @document.new('name' => "Doc 2")
|
684
691
|
doc_1.should_not eql?(doc_2)
|
685
692
|
end
|
686
693
|
|
694
|
+
should "not be eql? when comparing other object types" do
|
695
|
+
doc = @document.new('name' => "Doc")
|
696
|
+
doc.should_not eql?(nil)
|
697
|
+
doc.should_not eql?(false)
|
698
|
+
doc.should_not eql?({ 'name' => "Doc" })
|
699
|
+
end
|
700
|
+
|
687
701
|
should "not be eql? if types are different even if values are the same" do
|
688
702
|
@person = Class.new do
|
689
703
|
include MongoMapper::EmbeddedDocument
|