Alien-Taco

 view release on metacpan or  search on metacpan

t/4_client_msg.t  view on Meta::CPAN

is_deeply($t->msg(), {
        action => 'get_class_attribute',
        class => 'Class::Name',
        name => 'att_name',
    },
    'get_class_attribute');

$t->get_value('var_name');

is_deeply($t->msg(), {
        action => 'get_value',
        name => 'var_name',
    },
    'get_value');

$t->import_module('Mod::Name', args => [':tag'], kwargs => {x => 7});

is_deeply($t->msg(), {
        action => 'import_module',
        name => 'Mod::Name',
        args => [':tag'],
        kwargs => {x => 7},
    },
    'import_module');

$o->set_attribute('att_name', 999);

is_deeply($t->msg(), {
        action => 'set_attribute',
        number => 88,
        name => 'att_name',
        value => 999,
    },
    'set_attribute');

$t->set_class_attribute('Class::Name', 'att_name', 2468);

is_deeply($t->msg(), {
        action => 'set_class_attribute',
        class => 'Class::Name',
        name => 'att_name',
        value => 2468,
    },
    'set_class_attribute');

$t->set_value('var_name', '!');

is_deeply($t->msg(), {
        action => 'set_value',
        name => 'var_name',
        value => '!',
    },
    'set_value');


# A test client which just stores message hashes rather than attempting
# to send them.

package TestClient;

use parent 'Alien::Taco';

sub new {
    my $class = shift;

    return bless {msg => undef}, $class;
}

sub _interact {
    my $self = shift;
    $self->{'msg'} = shift;
}

sub msg {
    my $self = shift;
    return $self->{'msg'};
}



( run in 0.455 second using v1.01-cache-2.11-cpan-e1769b4cff6 )