Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Conversation

@TBSliver
Copy link
Contributor

No description provided.

Copy link
Contributor

@xdg xdg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good. Just a couple minor changes, please.

my @dbs = $client->database_names;
List of all database names on the MongoDB server. Supports filters in the same
way as L</"list_databases">.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an example here as well for clarity.

}
my @all_dbs = $conn->list_databases;

ok( scalar( @all_dbs ) > 6, "Found at least 6 databases" );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

>= 6 here? Usually there would be 'admin' and 'test', but let's not make that assumption.


for my $prefix ( qw/ foo bar baz / ) {
my $db1 = $conn->get_database( $prefix . $time_prefix . int(rand(99999)) ) or die "Can't get database\n";
my $db2 = $conn->get_database( $prefix . $time_prefix . int(rand(99999)) ) or die "Can't get database\n";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of getting databases this way, how about having get_test_db take an optional prefix (defaulting to 'testdb') and using that? That would have the added advantage of registering the databases for cleanup in the END step, which would mean you can remove lines 74-76.

my $time_prefix = time();

for my $prefix ( qw/ foo bar baz / ) {
my $db1 = $conn->get_database( $prefix . $time_prefix . int(rand(99999)) ) or die "Can't get database\n";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto comments above

@coveralls
Copy link

Coverage Status

Coverage increased (+0.08%) to 83.828% when pulling 379deff on shadow-dot-cat:TBSliver/PERL-805 into c43e367 on mongodb:master.

@xdg
Copy link
Contributor

xdg commented Dec 20, 2017

Squashed and merged.

@xdg xdg closed this Dec 20, 2017
@TBSliver TBSliver deleted the TBSliver/PERL-805 branch January 26, 2018 15:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants