Explorar el Código

Added extra check to make sure that mocking json is available on the given platform, otherwise skips the tests

Aditya Ivaturi hace 14 años
padre
commit
3f0884a091
Se han modificado 2 ficheros con 8 adiciones y 0 borrados
  1. 4 0
      t/01-driver.t
  2. 4 0
      t/02-webelement.t

+ 4 - 0
t/01-driver.t

@@ -27,6 +27,10 @@ BEGIN {
 
 my $record = (defined $ENV{'WD_MOCKING_RECORD'} && ($ENV{'WD_MOCKING_RECORD'}==1))?1:0;
 my $mock_file = '01-driver-mock-'.$^O.'.json';
+if (!$record && !(-e "t/mock-recordings/$mock_file"))
+{
+   plan skip_all => "Mocking of tests is not been enabled for this platform";
+}
 t::lib::MockSeleniumWebDriver::register($record,"t/mock-recordings/$mock_file");
 
 # Start our local http server

+ 4 - 0
t/02-webelement.t

@@ -27,6 +27,10 @@ BEGIN {
 
 my $record = (defined $ENV{'WD_MOCKING_RECORD'} && ($ENV{'WD_MOCKING_RECORD'}==1))?1:0;
 my $mock_file = '02-webelement-mock-'.$^O.'.json';
+if (!$record && !(-e "t/mock-recordings/$mock_file"))
+{
+   plan skip_all => "Mocking of tests is not been enabled for this platform";
+}
 t::lib::MockSeleniumWebDriver::register($record,"t/mock-recordings/$mock_file");
 
 # Start our local http server