| 1 | #!/usr/bin/perl |
| 2 | |
| 3 | use strict; |
| 4 | use warnings; |
| 5 | |
| 6 | use Test::More 'no_plan'; |
| 7 | |
| 8 | use ok 'Crypt::Util' => ( |
| 9 | qw/:crypt default_key exported_instance encode_string/, |
| 10 | defaults => { |
| 11 | key => "moose", |
| 12 | encode => 1, |
| 13 | }, |
| 14 | ); |
| 15 | |
| 16 | is( default_key, "moose", "default key set through defaults" ); |
| 17 | |
| 18 | default_key("bar"); |
| 19 | |
| 20 | is( default_key, "bar", "can be used as a setter, too" ); |
| 21 | |
| 22 | isa_ok( exported_instance, "Crypt::Util" ); |
| 23 | |
| 24 | like( |
| 25 | encode_string("eagles may soar, but cows don't get sucked into jet engines"), |
| 26 | qr/^[a-f0-9]+$/, |
| 27 | "encode", |
| 28 | ); |
| 29 |