Skip to content

Commit

Permalink
Update tests to reflect changes to methods
Browse files Browse the repository at this point in the history
  • Loading branch information
LoonyPandora committed Apr 6, 2012
1 parent 6f28240 commit bbd305d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
3 changes: 2 additions & 1 deletion t/003_methods.t → t/002_methods.t
@@ -1,4 +1,4 @@
use Test::More tests => 2;
use Test::More tests => 3;

use strict;
use warnings;
Expand All @@ -12,6 +12,7 @@ my $cost = 1;
# Object is reset after each hash is generated
my $ctx = Digest::Bcrypt->new;

can_ok($ctx, qw/new clone add digest hexdigest b64digest bcrypt_b64digest salt reset/);

$ctx->add($secret);
$ctx->salt($salt);
Expand Down
11 changes: 9 additions & 2 deletions t/002_create_digests.t → t/003_create_digests.t
@@ -1,4 +1,4 @@
use Test::More tests => 3;
use Test::More tests => 4;

use strict;
use warnings;
Expand Down Expand Up @@ -31,4 +31,11 @@ $ctx->add($secret);
$ctx->salt($salt);
$ctx->cost($cost);

ok($ctx->b64digest eq 'dIa9zl7nOwQ6pVqHC.i98M8chDXMGna', "Creates Base 64 Digest");
ok($ctx->b64digest eq 'fKc/1n9pQyS8rXsJEAk/+O+ejFZOIpc', "Creates Base 64 Digest");


$ctx->add($secret);
$ctx->salt($salt);
$ctx->cost($cost);

ok($ctx->bcrypt_b64digest eq 'dIa9zl7nOwQ6pVqHC.i98M8chDXMGna', "Creates Bcrypt Base 64 Digest");
11 changes: 9 additions & 2 deletions t/004_indirect_object_creation.t
@@ -1,4 +1,4 @@
use Test::More tests => 3;
use Test::More tests => 4;

use strict;
use warnings;
Expand Down Expand Up @@ -31,4 +31,11 @@ $ctx->add($secret);
$ctx->salt($salt);
$ctx->cost($cost);

ok($ctx->b64digest eq 'dIa9zl7nOwQ6pVqHC.i98M8chDXMGna', "Creates Base 64 Digest");
ok($ctx->b64digest eq 'fKc/1n9pQyS8rXsJEAk/+O+ejFZOIpc', "Creates Base 64 Digest");


$ctx->add($secret);
$ctx->salt($salt);
$ctx->cost($cost);

ok($ctx->bcrypt_b64digest eq 'dIa9zl7nOwQ6pVqHC.i98M8chDXMGna', "Creates Bcrypt Base 64 Digest");

0 comments on commit bbd305d

Please sign in to comment.