-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow some external control of which HTTP UA program to use,
with this global variable: $App::perlbrew::HTTP_USER_AGENT_PROGRAM The value can only be one of the know program names.
- Loading branch information
Showing
2 changed files
with
42 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env perl | ||
use strict; | ||
use warnings; | ||
|
||
use FindBin; | ||
use lib $FindBin::Bin; | ||
use App::perlbrew; | ||
require 'test_helpers.pl'; | ||
|
||
use Test::More; | ||
use Test::Exception; | ||
|
||
for (qw(curl wget fetch)) { | ||
$App::perlbrew::HTTP_USER_AGENT_PROGRAM = "curl"; | ||
is App::perlbrew::http_user_agent_program(), "curl"; | ||
} | ||
|
||
$App::perlbrew::HTTP_USER_AGENT_PROGRAM = "something-that-is-not-recognized"; | ||
dies_ok { | ||
App::perlbrew::http_user_agent_program(); | ||
} "should die when asked to use unrecognized http UA program"; | ||
|
||
done_testing; |