diff --git a/t/test/mojo.t b/t/test/mojo.t index a79bce4f45..f4f00cfdb3 100644 --- a/t/test/mojo.t +++ b/t/test/mojo.t @@ -145,6 +145,31 @@ subtest 'attr_is' => sub { is_deeply \@args, ['is', 'test', 'wrong', 'some description'], 'right result'; }; +subtest 'attr_isnt' => sub { + $t->tx->res->body('

Test

'); + $t->attr_isnt('p', 'id', 'wrong'); + is_deeply \@args, ['isnt', 'test', 'wrong', 'no match for attribute "id" at selector "p"'], 'right result'; + $t->attr_isnt('p', 'id', 'wrong', 'some description'); + is_deeply \@args, ['isnt', 'test', 'wrong', 'some description'], 'right result'; +}; + +subtest 'attr_like' => sub { + $t->tx->res->body('

Test

'); + $t->attr_like('p', 'id', qr/test/); + is_deeply \@args, ['like', 'test', qr/test/, 'similar match for attribute "id" at selector "p"'], 'right result'; + $t->attr_like('p', 'id', qr/test/, 'some description'); + is_deeply \@args, ['like', 'test', qr/test/, 'some description'], 'right result'; +}; + +subtest 'attr_unlike' => sub { + $t->tx->res->body('

Test

'); + $t->attr_unlike('p', 'id', qr/wrong/); + is_deeply \@args, ['unlike', 'test', qr/wrong/, 'no similar match for attribute "id" at selector "p"'], + 'right result'; + $t->attr_unlike('p', 'id', qr/wrong/, 'some description'); + is_deeply \@args, ['unlike', 'test', qr/wrong/, 'some description'], 'right result'; +}; + subtest 'header_exists' => sub { $t->header_exists('Content-Type'); is_deeply \@args, ['ok', 1, 'header "Content-Type" exists'], 'right result';