Guest User

Untitled

a guest
Nov 19th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  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. }
Add Comment
Please, Sign In to add comment