X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fstorage%2Freplicated.t;h=59bf7e575b3910dfa32fe52e6eec2f4cca2fec1a;hb=67cbc0a8171b13f8c90ec5c5184d598a3b63e007;hp=9ecc7e8261e06b6efcb373b9a18baf960efda706;hpb=b4976ee31c2f188f9aa8f226a3155bf15a7da36b;p=dbsrgits%2FDBIx-Class.git diff --git a/t/storage/replicated.t b/t/storage/replicated.t index 9ecc7e8..59bf7e5 100644 --- a/t/storage/replicated.t +++ b/t/storage/replicated.t @@ -709,9 +709,19 @@ ok my $reliably = sub { is $debug{storage_type}, 'MASTER', "got last query from a master: $debug{dsn}"; + $_[1] = 9; + } => 'created coderef properly'; -$replicated->schema->storage->execute_reliably($reliably); +my @list_to_mangle = (1, 2, 3); + +$replicated->schema->storage->execute_reliably($reliably, @list_to_mangle); + +is_deeply + \@list_to_mangle, + [ 1, 9, 3], + 'Aliasing of values passed to execute_reliably works' +; ## Try something with an error @@ -726,6 +736,12 @@ throws_ok {$replicated->schema->storage->execute_reliably($unreliably)} qr/Can't find source for ArtistXX/ => 'Bad coderef throws proper error'; +throws_ok { + $replicated->schema->storage->execute_reliably(sub{ + die bless [], 'SomeExceptionThing'; + }); +} 'SomeExceptionThing', "Blessed exception kept intact"; + ## Make sure replication came back ok $replicated->schema->resultset('Artist')->find(3)