| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package CHI::Driver::MongoDB::t::CHIDriverTests; | 
| 2 |  |  |  |  |  |  | $CHI::Driver::MongoDB::t::CHIDriverTests::VERSION = '0.0001'; | 
| 3 |  |  |  |  |  |  | # ABSTRACT: Wrapper for the CHI driver test suite | 
| 4 |  |  |  |  |  |  |  | 
| 5 | 1 |  |  | 1 |  | 394 | use strict; | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 20 |  | 
| 6 | 1 |  |  | 1 |  | 3 | use warnings; | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 17 |  | 
| 7 | 1 |  |  | 1 |  | 430 | use CHI::Test; | 
|  | 1 |  |  |  |  | 160457 |  | 
|  | 1 |  |  |  |  | 5 |  | 
| 8 | 1 |  |  | 1 |  | 20044 | use base qw(CHI::t::Driver); | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 601 |  | 
| 9 |  |  |  |  |  |  |  | 
| 10 | 0 |  |  | 0 | 0 |  | sub testing_driver_class {'CHI::Driver::MongoDB'} | 
| 11 |  |  |  |  |  |  |  | 
| 12 |  |  |  |  |  |  | # Flags indicating what each test driver supports | 
| 13 | 0 |  |  | 0 | 0 |  | sub supports_clear              {1} | 
| 14 | 0 |  |  | 0 | 0 |  | sub supports_expires_on_backend {1} | 
| 15 | 0 |  |  | 0 | 0 |  | sub supports_get_namespaces     {1} | 
| 16 |  |  |  |  |  |  |  | 
| 17 |  |  |  |  |  |  |  | 
| 18 |  |  |  |  |  |  | sub new_cache_options { | 
| 19 | 0 |  |  | 0 | 0 |  | my $self = shift; | 
| 20 |  |  |  |  |  |  |  | 
| 21 |  |  |  |  |  |  | return ( | 
| 22 |  |  |  |  |  |  | $self->SUPER::new_cache_options(), | 
| 23 |  |  |  |  |  |  |  | 
| 24 |  |  |  |  |  |  | # Any necessary CHI->new parameters for your test driver | 
| 25 | 0 |  | 0 |  |  |  | connection_uri => $ENV{'MONGODB_CONNECTION_URI'} // 'mongodb://127.0.0.1:27017', | 
| 26 |  |  |  |  |  |  | db_name        => '_CHI_TESTING_', | 
| 27 |  |  |  |  |  |  | ); | 
| 28 |  |  |  |  |  |  | } | 
| 29 |  |  |  |  |  |  |  | 
| 30 |  |  |  |  |  |  |  | 
| 31 |  |  |  |  |  |  | sub _drop_at_startup : Test(startup) { | 
| 32 | 0 |  |  | 0 |  | 0 | diag "Dropping database prior to running any tests..."; | 
| 33 | 0 |  |  |  |  | 0 | goto &_drop_db; | 
| 34 | 1 |  |  | 1 |  | 51918 | } | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 3 |  | 
| 35 |  |  |  |  |  |  |  | 
| 36 |  |  |  |  |  |  |  | 
| 37 |  |  |  |  |  |  | sub _drop_at_setup : Test(setup) { | 
| 38 | 0 |  |  | 0 |  | 0 | goto &_drop_db; | 
| 39 | 1 |  |  | 1 |  | 208 | } | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 3 |  | 
| 40 |  |  |  |  |  |  |  | 
| 41 |  |  |  |  |  |  |  | 
| 42 |  |  |  |  |  |  | sub _drop_at_shutdown : Test(shutdown) { | 
| 43 | 0 |  |  | 0 |  |  | diag "Dropping database after final test..."; | 
| 44 | 0 |  |  |  |  |  | goto &_drop_db; | 
| 45 | 1 |  |  | 1 |  | 195 | } | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 3 |  | 
| 46 |  |  |  |  |  |  |  | 
| 47 |  |  |  |  |  |  |  | 
| 48 |  |  |  |  |  |  | sub _drop_db { | 
| 49 | 0 |  |  | 0 |  |  | my $self = shift; | 
| 50 |  |  |  |  |  |  |  | 
| 51 | 0 |  |  |  |  |  | my $cache = $self->new_cache; | 
| 52 | 0 |  |  |  |  |  | $cache->mongodb->get_database( $cache->db_name )->drop; | 
| 53 |  |  |  |  |  |  | } | 
| 54 |  |  |  |  |  |  |  | 
| 55 |  |  |  |  |  |  | 1; | 
| 56 |  |  |  |  |  |  |  | 
| 57 |  |  |  |  |  |  | __END__ | 
| 58 |  |  |  |  |  |  |  | 
| 59 |  |  |  |  |  |  | =pod | 
| 60 |  |  |  |  |  |  |  | 
| 61 |  |  |  |  |  |  | =encoding UTF-8 | 
| 62 |  |  |  |  |  |  |  | 
| 63 |  |  |  |  |  |  | =head1 NAME | 
| 64 |  |  |  |  |  |  |  | 
| 65 |  |  |  |  |  |  | CHI::Driver::MongoDB::t::CHIDriverTests - Wrapper for the CHI driver test suite | 
| 66 |  |  |  |  |  |  |  | 
| 67 |  |  |  |  |  |  | =head1 VERSION | 
| 68 |  |  |  |  |  |  |  | 
| 69 |  |  |  |  |  |  | version 0.0001 | 
| 70 |  |  |  |  |  |  |  | 
| 71 |  |  |  |  |  |  | =head1 AUTHOR | 
| 72 |  |  |  |  |  |  |  | 
| 73 |  |  |  |  |  |  | Heiko Jansen <hjansen@cpan.org> | 
| 74 |  |  |  |  |  |  |  | 
| 75 |  |  |  |  |  |  | =head1 COPYRIGHT AND LICENSE | 
| 76 |  |  |  |  |  |  |  | 
| 77 |  |  |  |  |  |  | This software is copyright (c) 2016 by Heiko Jansen. | 
| 78 |  |  |  |  |  |  |  | 
| 79 |  |  |  |  |  |  | This is free software; you can redistribute it and/or modify it under | 
| 80 |  |  |  |  |  |  | the same terms as the Perl 5 programming language system itself. | 
| 81 |  |  |  |  |  |  |  | 
| 82 |  |  |  |  |  |  | =cut |