SockJS/Transport.pm untested

filter: Statementstmt 0.0% 0 / 46 Branchbran 0.0% 0 / 18 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 11 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 81 CC 10 SCAR 40.3
CC
10
Cov
0%
build
110.0
BEGIN
2.0
BEGIN
2.0
CRAP 56.0
1 package SockJS::Transport;
2  
3 use strict;
4 use warnings;
5  
6 use SockJS::Transport::EventSource;
7 use SockJS::Transport::HtmlFile;
8 use SockJS::Transport::WebSocket;
9 use SockJS::Transport::XHRPolling;
10 use SockJS::Transport::XHRSend;
11 use SockJS::Transport::XHRStreaming;
12 use SockJS::Transport::JSONPPolling;
13 use SockJS::Transport::JSONPSend;
14  
15 sub build {
16 my $self = shift;
17 my $path = shift;
18  
19 my $class;
20  
21 if ($path eq 'xhr') {
22 $class = 'XHRPolling';
23 }
24 elsif ($path eq 'xhr_send') {
25 $class = 'XHRSend';
26 }
27 elsif ($path eq 'xhr_streaming') {
28 $class = 'XHRStreaming';
29 }
30 if ($path eq 'jsonp') {
31 $class = 'JSONPPolling';
32 }
33 elsif ($path eq 'jsonp_send') {
34 $class = 'JSONPSend';
35 }
36 elsif ($path eq 'websocket' || $path eq 'raw_websocket') {
37 $class = 'WebSocket';
38 }
39 elsif ($path eq 'eventsource') {
40 $class = 'EventSource';
41 }
42 elsif ($path eq 'htmlfile') {
43 $class = 'HtmlFile';
44 }
45  
46 return unless $class;
47  
48 $class = "SockJS::Transport::$class";
49  
50 return $class->new(name => $path, @_);
51 }
52  
53 1;