Skip to content

Instantly share code, notes, and snippets.

@und3f
Created March 21, 2011 19:52
Show Gist options
  • Save und3f/880081 to your computer and use it in GitHub Desktop.
Save und3f/880081 to your computer and use it in GitHub Desktop.
=head1 NAME
Protocol::Redis::Test - reusable tests for Protocol::Redis implementations.
=head1 SYNOPSIS
use Test::More plan => 5;
use Protocol::Redis::Test;
use_ok 'Protocol::Redis';
my $redis = new_ok 'Protocol::Redis';
my $test = Protocol::Redis::Test->new($redis);
# All Protocol::Redis methods present
$test->methods_ok;
# Parsing works as expected
$test->parse_string_ok;
$test->parse_bulk_ok;
$test->parse_multi_bulk_ok;
# Message encoding works as expected
$test->encode_ok;
=head1 DESCRIPTION
Reusable tests for Protocol::Redis implementations.
=head1 METHODS
=head2 C<methods_ok>
$test->methods_ok;
Check if all methods are present.
=head2 C<parse_string_ok>
Check if parsing of status, error and integers messages works correctly
=head2 C<parse_bulk_ok>
Check if parsing of bulk messages works correctly.
=head2 C<parse_multi_bulk_ok>
Check if parsing of multi-bulk messages works correctly.
=head2 C<encode_ok>
Check if encoding works correctly.
=head1 SEE ALSO
L<Protocol::Redis>
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2010-2011, Sergey Zasenko
This program is free software, you can redistribute it and/or modify it under
the terms of the Artistic License version 2.0.
=cut
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment