daily pastebin goal
26%
SHARE
TWEET

Untitled

a guest Nov 19th, 2017 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. sub _has_email_tests {
  2.     subtest '_has_email returns JSON::TRUE when true' => sub {
  3.         my $api  = HP::API::Twofactorauth->new();
  4.  
  5.         my $fake_token = UnitTest::FakeObject->new(
  6.             get_email => 1
  7.         );
  8.  
  9.         my $result   = $api->_has_email('cust', $fake_token);
  10.  
  11.         cmp_deeply($result, JSON::true);
  12.     };
  13.  
  14.     subtest '_has_email returns JSON::false when false' => sub {
  15.         my $api  = HP::API::Twofactorauth->new();
  16.  
  17.         my $fake_token = UnitTest::FakeObject->new(
  18.             get_email => 0
  19.         );
  20.  
  21.         my $result   = $api->_has_email('cust', $fake_token);
  22.  
  23.         cmp_deeply($result, JSON::false);
  24.     };
  25. }
RAW Paste Data
Top