File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -116,13 +116,6 @@ def to_a
116116 @data . dup
117117 end
118118
119- # Returns the object id as a single element in an array for use with Kernel#Array
120- #
121- # @return [Array]
122- def to_ary
123- [ self ]
124- end
125-
126119 # Given a string representation of an ObjectId, return a new ObjectId
127120 # with that value.
128121 #
Original file line number Diff line number Diff line change @@ -136,9 +136,13 @@ def test_as_json
136136 assert_equal ( { "$oid" => id . to_s } , id . as_json )
137137 end
138138
139- def test_to_ary
139+ def test_object_id_array_flatten
140140 id = ObjectId . new
141- assert_equal [ id ] , id . to_ary
142- assert_equal Array ( id ) , id . to_ary
141+ assert_equal [ id ] , [ [ id ] ] . flatten
142+ end
143+
144+ def test_object_id_array_flatten_bang
145+ id = ObjectId . new
146+ assert_equal [ id ] , [ [ id ] ] . flatten!
143147 end
144148end
You can’t perform that action at this time.
0 commit comments