From a6fdd1f6f7a23d03796a04d51220478a50194146 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 14 Jun 2015 00:52:37 -0400 Subject: Get tests working to test `prettify_hipchat` sub * test.sh: Create a temporary file `prettify_hipchat.pl` that contains only the `prettify_hipchat` subroutine. Then run `test.pl`. Finally remove the file we created to contain the subroutine. * Require `prettify_hipchat.pl` from test.pl. This file contains only the `prettify_hipchat` subroutine, allowing us to require it without concern. --- test.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) mode change 100644 => 100755 test.sh (limited to 'test.sh') diff --git a/test.sh b/test.sh old mode 100644 new mode 100755 index 209ccdb..9449eca --- a/test.sh +++ b/test.sh @@ -1,3 +1,15 @@ #!/usr/bin/env sh -pcregrep -M '^sub prettify_hipchat {.*(\n|.)*?}' hipchat-stfu.pl +sub=$(pcregrep -M '^sub prettify_hipchat {.*(\n|.)*?}' hipchat-stfu.pl) + +cat > prettify_hipchat.pl <