force-load Moo::HandleMoose::_TypeMap
[scpubgit/Object-Remote.git] / t / basic_data.t
CommitLineData
7462160e 1use strictures 1;
2use Test::More;
3use Sys::Hostname qw(hostname);
4
abef6e5b 5$ENV{OBJECT_REMOTE_TEST_LOGGER} = 1;
f129bfaf 6
7462160e 7use Object::Remote::FromData;
8
9my $connection = Object::Remote->connect('-');
10
11my $remote = My::Data::TestClass->new::on($connection);
12
13is($remote->counter, 0, 'Counter at 0');
14
15is($remote->increment, 1, 'Increment to 1');
16
17is($remote->counter, 1, 'Counter at 1');
18
19is(
20 My::Data::TestPackage->can::on($connection, 'hostname')->(),
21 hostname(),
22 'Remote sub call ok'
23);
24
25done_testing;
26
27__DATA__
28package My::Data::TestClass;
29
30use Moo;
31
32has counter => (is => 'rwp', default => sub { 0 });
33
34sub increment { $_[0]->_set_counter($_[0]->counter + 1); }
35
36package My::Data::TestPackage;
37
38use Sys::Hostname;