File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
lib/mongo/operation/list_collections Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,11 @@ def execute(server)
44
44
45
45
private
46
46
47
+ def selector ( server )
48
+ ( spec [ SELECTOR ] || { } ) . merge (
49
+ listCollections : 1 , filter : { name : { '$not' => /system\. |\$ / } } )
50
+ end
51
+
47
52
def message ( server )
48
53
Protocol ::Msg . new ( flags , options , command ( server ) )
49
54
end
Original file line number Diff line number Diff line change 200
200
it 'returns collection objects for each name' do
201
201
expect ( database . collections ) . to include ( collection )
202
202
end
203
+
204
+ it 'does not include the system collections' do
205
+ expect ( database . collections . collect ( &:name ) . none? { |name | name =~ /system\. |\$ / } ) . to be ( true )
206
+ end
203
207
end
204
208
205
209
context 'when the database does not exist' do
You can’t perform that action at this time.
0 commit comments