summaryrefslogtreecommitdiff
path: root/t/lib/test_account.pl
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-12-12 16:31:06 -0800
committerIvan Kohler <ivan@freeside.biz>2012-12-12 16:31:06 -0800
commit1d339ad33855e8df8c1f466b494acbfd0e0907da (patch)
treea4a609605840d1ebf666e651efd41663d8f7da83 /t/lib/test_account.pl
initial commit
Diffstat (limited to 't/lib/test_account.pl')
-rw-r--r--t/lib/test_account.pl29
1 files changed, 29 insertions, 0 deletions
diff --git a/t/lib/test_account.pl b/t/lib/test_account.pl
new file mode 100644
index 0000000..c52067d
--- /dev/null
+++ b/t/lib/test_account.pl
@@ -0,0 +1,29 @@
+use Test::More;
+
+sub test_account_or_skip {
+ my($login, $password) = test_account();
+
+ unless( defined $login ) {
+ plan skip_all => "No test account";
+ }
+
+ return($login, $password);
+}
+
+sub test_account {
+ open TEST_ACCOUNT, "t/test_account" or return;
+ my($login, $password, $hostport) = <TEST_ACCOUNT>;
+ chomp $login;
+ chomp $password;
+ chomp $hostport;
+
+ if ( $hostport =~ /^\s*([\w\.]+)(:(\d+))?\s*$/ ) {
+ my($host, $port) = ($1, $3);
+ $Net::VoIP_Innovations::HOST = $host;
+ $Net::VoIP_Innovations::PORT = $port;
+ }
+
+ return($login, $password);
+}
+
+1;