start at 0.3.1 instead of 0.3.0
[scpubgit/Object-Remote.git] / t / reconnect.t
CommitLineData
d3944ab9 1use strictures 1;
2use Test::More;
3
4use Object::Remote;
5use Object::Remote::FromData;
6
7my $conn1 = Reconnector->new::on('-');
8my $conn2 = $conn1->connect;
9
10isa_ok($conn1, 'Object::Remote::Proxy');
11isa_ok($conn2, 'Object::Remote::Proxy');
12
13my $root_pid = $$;
14my $conn1_pid = $conn1->pid;
15my $conn2_pid = $conn2->pid;
16
17ok($root_pid != $conn1_pid, "Root and conn1 are not the same interpreter instance");
18ok($root_pid != $conn2_pid, "Root and conn2 are not the same interpreter instance");
19ok($conn1_pid != $conn2_pid, "conn1 and conn2 are not the same interpreter instance");
20
21ok($conn1->ping eq "pong", "Ping success on conn1");
22ok($conn2->ping eq "pong", "Ping success on conn2");
23
24done_testing;
25
26__DATA__
27
28package Reconnector;
29
30use Moo;
31
32sub connect {
33 return Reconnector->new::on('-');
34}
35
36sub pid {
37 return $$;
38}
39
40sub ping {
41 return 'pong';
42}