MongoDB/t/CHIDriverTests.pm

filter: Statementstmt 62.1% 23 / 37 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 43.7% 7 / 16 Podpod 0.0% 0 / 5 totaltotal 50.0% 30 / 60 CC 2 SCAR 7.2
CC
2
Cov
59%
new_cache_options
6.0
testing_driver_class
2.0
supports_clear
2.0
CRAP 2.1
« MongoDB.pm ↑ Summary
1 package CHI::Driver::MongoDB::t::CHIDriverTests;
2 1 $CHI::Driver::MongoDB::t::CHIDriverTests::VERSION = '0.0100';
3 # ABSTRACT: Wrapper for the CHI driver test suite
4  
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use CHI::Test;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use base qw(CHI::t::Driver);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 0 ▶sub testing_driver_class {'CHI::Driver::MongoDB'}
Subroutine testing_driver_class: not called CC=1 SCAR=6.9
Pod undocumented
11  
12 # Flags indicating what each test driver supports
13 0 ▶sub supports_clear {1}
Subroutine supports_clear: not called CC=1 SCAR=6.9
Pod undocumented
14 0 ▶sub supports_expires_on_backend {1}
Subroutine supports_expires_on_backend: not called CC=1 SCAR=6.9
Pod undocumented
15 0 ▶sub supports_get_namespaces {1}
Subroutine supports_get_namespaces: not called CC=1 SCAR=6.9
Pod undocumented
16  
17  
18 sub new_cache_options {
19 0 ▶ my $self = shift;
Subroutine new_cache_options: not called CC=2 SCAR=17.9
Pod undocumented
20  
21 return (
22 $self->SUPER::new_cache_options(),
23  
24 # Any necessary CHI->new parameters for your test driver
25 0 ▶ connection_uri => defined( $ENV{'MONGODB_CONNECTION_URI'} ) ? $ENV{'MONGODB_CONNECTION_URI'} : 'mongodb://127.0.0.1:27017',
Branch: 1 branch
BranchTrueFalseTotal
defined $ENV{'MONGODB_CONNECTION_URI'} ? : 0 0 0
26 db_name => '_CHI_TESTING_',
27 );
28 }
29  
30  
31 sub _drop_at_startup : Test(startup) {
32 0 ▶ diag "Dropping database prior to running any tests...";
Subroutine _drop_at_startup: not called CC=1 SCAR=6.9
33 0 goto &_drop_db;
34 1 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
35  
36  
37 sub _drop_at_setup : Test(setup) {
38 0 ▶ goto &_drop_db;
Subroutine _drop_at_setup: not called CC=1 SCAR=6.9
39 1 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
40  
41  
42 sub _drop_at_shutdown : Test(shutdown) {
43 0 ▶ diag "Dropping database after final test...";
Subroutine _drop_at_shutdown: not called CC=1 SCAR=6.9
44 0 goto &_drop_db;
45 1 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
46  
47  
48 sub _drop_db {
49 0 ▶ my $self = shift;
Subroutine _drop_db: not called CC=1 SCAR=6.9
50  
51 0 my $cache = $self->new_cache;
52 0 $cache->mongodb->get_database( $cache->db_name )->drop;
53 }
54  
55 1 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.0100
70  
71 =head1 AUTHOR
72  
73 Heiko Jansen <hjansen@cpan.org>
74  
75 =head1 COPYRIGHT AND LICENSE
76  
77 This software is copyright (c) 2018 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
« MongoDB.pm ↑ Summary