Sfoglia il codice sorgente

Made spec attribute not required anymore

Emmanuel Peroumalnaik 11 anni fa
parent
commit
d891a4b501

+ 8 - 3
.travis.yml

@@ -6,13 +6,18 @@ perl:
    - 5.14
    - 5.12
    - 5.10
+   - 5.8
+matrix:
+   allow_failures:
+      - perl: 5.8
+   fast_finish: true
 before_install:
-   - export AUTOMATED_TESTING=1 HARNESS_OPTIONS=j10:c HARNESS_TIMER=1
+   - export AUTOMATED_TESTING=1 NONINTERACTIVE_TESTING=1 HARNESS_OPTIONS=j10:c HARNESS_TIMER=1
    - git config --global user.name "TravisCI"
    - git config --global user.email $HOSTNAME":not-for-mail@travis-ci.org"
 install:
    - cpanm --quiet --notest --skip-satisfied Dist::Zilla
-   - "dzil authordeps | grep -vP '[^\\w:]' | xargs -n 5 -P 10 cpanm --quiet --notest --skip-satisfied"
-   - "dzil listdeps   | grep -vP '[^\\w:]' | cpanm --verbose --skip-satisfied"
+   - "dzil authordeps --missing | grep -vP '[^\\w:]' | xargs -n 5 -P 10 cpanm --quiet --notest"
+   - "dzil listdeps   --missing | grep -vP '[^\\w:]' | cpanm --verbose"
 script:
    - dzil smoke --release --author

+ 2 - 3
cpanfile

@@ -8,6 +8,7 @@ requires "File::Copy" => "0";
 requires "File::Temp" => "0";
 requires "HTTP::Headers" => "0";
 requires "HTTP::Request" => "0";
+requires "HTTP::Response" => "0";
 requires "IO::Compress::Zip" => "0";
 requires "IO::Socket" => "0";
 requires "JSON" => "0";
@@ -33,11 +34,9 @@ on 'test' => sub {
   requires "File::stat" => "0";
   requires "LWP::Protocol::PSGI" => "0.04";
   requires "LWP::Simple" => "0";
+  requires "Test::Exception" => "0";
   requires "Test::LWP::UserAgent" => "0";
-  requires "Test::MockObject" => "0";
-  requires "Test::MockObject::Extends" => "0";
   requires "Test::More" => "0";
-  requires "Test::Tester" => "0";
 };
 
 on 'configure' => sub {

+ 1 - 0
lib/Selenium/Remote/Mock/Commands.pm

@@ -1,4 +1,5 @@
 package Selenium::Remote::Mock::Commands; 
+# ABSTRACT: utility class to mock Selenium::Remote::Commands 
 use Moo; 
 extends 'Selenium::Remote::Commands';
 

+ 33 - 1
lib/Selenium/Remote/Mock/RemoteConnection.pm

@@ -12,7 +12,7 @@ extends 'Selenium::Remote::RemoteConnection';
 
 has 'spec' => (
     is       => 'ro',
-    required => 1,
+    default => sub {{}},
 );
 
 has 'mock_cmds' => ( 
@@ -185,3 +185,35 @@ sub request {
 }
 
 1;
+__END__
+
+=pod
+
+=head1 DESCRIPTION
+
+Selenium::Remote::Mock::RemoteConnection is a class to act as a short-circuit or a pass through to the connection to a Selenium Server. 
+Using this class in place of L<Selenium::Remote::RemoteConnection> allows to: 
+=over
+
+=item *
+record interactions with the Selenium Server into a JSON file 
+
+=item * 
+replay recorded interactions from a JSON file to mock answers from the Selenium Server
+
+=item * 
+mock responses to specific functions 
+
+=back
+
+=head1 SYNOPSIS
+
+=head2 Record interactions 
+
+    
+
+=head2 Replay interactions
+
+=head2 Mock responses
+
+=cut