aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-10-04 15:56:05 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-10-10 17:44:35 +0100
commit328e1933d1ada8b99bc69c15c7cdb01f3ce04a1d (patch)
treef2a16fbff0e372fff8c57e5fc00364e9a2565881 /perllib/FixMyStreet.pm
parent6f43693cfc58d5356fafd231f2a232eb2fd99ae5 (diff)
Better testing for tests run on live site.
When the tests are run normally, using bin/run-tests, 00-check-config.t is pointless as the config will have been newly set up from the example file. To prevent running except through run-tests, check when test_mode is set, dying if the live config file has been used.
Diffstat (limited to 'perllib/FixMyStreet.pm')
-rw-r--r--perllib/FixMyStreet.pm3
1 files changed, 3 insertions, 0 deletions
diff --git a/perllib/FixMyStreet.pm b/perllib/FixMyStreet.pm
index b3d963074..7ee497584 100644
--- a/perllib/FixMyStreet.pm
+++ b/perllib/FixMyStreet.pm
@@ -50,6 +50,9 @@ my $TEST_MODE = undef;
sub test_mode {
my $class = shift;
$TEST_MODE = shift if scalar @_;
+ # Make sure we don't run on live config
+ # uncoverable branch true
+ die "Do not run tests except through run-tests\n" if $TEST_MODE && $CONF_FILE eq 'general.yml';
return $TEST_MODE;
}