aboutsummaryrefslogtreecommitdiffstats
path: root/devel
diff options
context:
space:
mode:
authorsunpoet <sunpoet@FreeBSD.org>2012-04-30 11:10:50 +0800
committersunpoet <sunpoet@FreeBSD.org>2012-04-30 11:10:50 +0800
commit303a220da59c18be49f9cb8bf20e3fe9627c2825 (patch)
tree716056a994116581b099504757d066a52ec8aa00 /devel
parente664ccd7d3b06fd214b584a726c37b4bb850bcd4 (diff)
downloadfreebsd-ports-gnome-303a220da59c18be49f9cb8bf20e3fe9627c2825.tar.gz
freebsd-ports-gnome-303a220da59c18be49f9cb8bf20e3fe9627c2825.tar.zst
freebsd-ports-gnome-303a220da59c18be49f9cb8bf20e3fe9627c2825.zip
- Add p5-Test-Mock-LWP-Dispatch 0.03
Test::Mock::LWP::Dispatch intends for testing a code that heavily uses LWP::UserAgent. Assume that function you want to test makes three different request to the server and expects to get some content from the server. To test this function you should setup request/response mappings for mocked UserAgent and test it. For doing something with mappings, here are methods map, unmap and unmap_all. For controlling context of these mappings (is it applies for all created in your code LWP::UserAgent's or only to one specific?) you should call these functions for exported $mock_ua object (global mapping) or for newly created LWP::UserAgent (local mappings). See also on Test::Mock::LWP, it provides mocked LWP objects for you, so probably you can solve your problems with this module too. WWW: http://search.cpan.org/dist/Test-Mock-LWP-Dispatch/
Diffstat (limited to 'devel')
-rw-r--r--devel/Makefile1
-rw-r--r--devel/p5-Test-Mock-LWP-Dispatch/Makefile29
-rw-r--r--devel/p5-Test-Mock-LWP-Dispatch/distinfo2
-rw-r--r--devel/p5-Test-Mock-LWP-Dispatch/pkg-descr17
-rw-r--r--devel/p5-Test-Mock-LWP-Dispatch/pkg-plist9
5 files changed, 58 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile
index d81fadb40035..541137a29f06 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -2566,6 +2566,7 @@
SUBDIR += p5-Test-Mini
SUBDIR += p5-Test-Mini-Unit
SUBDIR += p5-Test-Mock-LWP
+ SUBDIR += p5-Test-Mock-LWP-Dispatch
SUBDIR += p5-Test-MockModule
SUBDIR += p5-Test-MockObject
SUBDIR += p5-Test-MockRandom
diff --git a/devel/p5-Test-Mock-LWP-Dispatch/Makefile b/devel/p5-Test-Mock-LWP-Dispatch/Makefile
new file mode 100644
index 000000000000..e6737e54b08e
--- /dev/null
+++ b/devel/p5-Test-Mock-LWP-Dispatch/Makefile
@@ -0,0 +1,29 @@
+# New ports collection makefile for: p5-Test-Mock-LWP-Dispatch
+# Date created: 2012-04-30
+# Whom: Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= Test-Mock-LWP-Dispatch
+PORTVERSION= 0.03
+CATEGORIES= devel perl5
+MASTER_SITES= CPAN
+PKGNAMEPREFIX= p5-
+
+MAINTAINER= sunpoet@FreeBSD.org
+COMMENT= Mocks LWP::UserAgent and dispatches your requests/responses
+
+BUILD_DEPENDS= p5-HTTP-Message>=0:${PORTSDIR}/www/p5-HTTP-Message \
+ p5-Moose>=0:${PORTSDIR}/devel/p5-Moose \
+ p5-Test-MockObject>=0:${PORTSDIR}/devel/p5-Test-MockObject \
+ p5-libwww>=0:${PORTSDIR}/www/p5-libwww
+RUN_DEPENDS:= ${BUILD_DEPENDS}
+
+TEST_DEPENDS= p5-Test-Exception>=0:${PORTSDIR}/devel/p5-Test-Exception
+
+PERL_CONFIGURE= yes
+
+MAN3= Test::Mock::LWP::Dispatch.3
+
+.include <bsd.port.mk>
diff --git a/devel/p5-Test-Mock-LWP-Dispatch/distinfo b/devel/p5-Test-Mock-LWP-Dispatch/distinfo
new file mode 100644
index 000000000000..7b8c43107d77
--- /dev/null
+++ b/devel/p5-Test-Mock-LWP-Dispatch/distinfo
@@ -0,0 +1,2 @@
+SHA256 (Test-Mock-LWP-Dispatch-0.03.tar.gz) = a7ede6c174ce872206508661a4b873a43673d911d4eb4dd59ff54fc67e96cd6e
+SIZE (Test-Mock-LWP-Dispatch-0.03.tar.gz) = 12168
diff --git a/devel/p5-Test-Mock-LWP-Dispatch/pkg-descr b/devel/p5-Test-Mock-LWP-Dispatch/pkg-descr
new file mode 100644
index 000000000000..2e0cf67309fd
--- /dev/null
+++ b/devel/p5-Test-Mock-LWP-Dispatch/pkg-descr
@@ -0,0 +1,17 @@
+Test::Mock::LWP::Dispatch intends for testing a code that heavily uses
+LWP::UserAgent.
+
+Assume that function you want to test makes three different request to the
+server and expects to get some content from the server. To test this function
+you should setup request/response mappings for mocked UserAgent and test it.
+
+For doing something with mappings, here are methods map, unmap and unmap_all.
+For controlling context of these mappings (is it applies for all created in your
+code LWP::UserAgent's or only to one specific?) you should call these functions
+for exported $mock_ua object (global mapping) or for newly created
+LWP::UserAgent (local mappings).
+
+See also on Test::Mock::LWP, it provides mocked LWP objects for you, so probably
+you can solve your problems with this module too.
+
+WWW: http://search.cpan.org/dist/Test-Mock-LWP-Dispatch/
diff --git a/devel/p5-Test-Mock-LWP-Dispatch/pkg-plist b/devel/p5-Test-Mock-LWP-Dispatch/pkg-plist
new file mode 100644
index 000000000000..eb884979dc56
--- /dev/null
+++ b/devel/p5-Test-Mock-LWP-Dispatch/pkg-plist
@@ -0,0 +1,9 @@
+%%SITE_PERL%%/Test/Mock/LWP/Dispatch.pm
+%%SITE_PERL%%/%%PERL_ARCH%%/auto/Test/Mock/LWP/Dispatch/.packlist
+@dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/Test/Mock/LWP/Dispatch
+@dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/Test/Mock/LWP
+@dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/Test/Mock
+@dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/Test
+@dirrmtry %%SITE_PERL%%/Test/Mock/LWP
+@dirrmtry %%SITE_PERL%%/Test/Mock
+@dirrmtry %%SITE_PERL%%/Test