recommends 'SQL::Translator' => 0.09004;
+feature 'Replication',
+ -default => 0,
+ 'Moose' => '0.88',
+ 'MooseX::AttributeHelpers' => '0.21',
+ 'MooseX::Types' => '0.16',
+ 'namespace::clean' => '0.11',
+ 'Hash::Merge' => '0.11';
+
+
install_script (qw|
script/dbicadmin
|);
delete $self->{_dirty_columns};
return unless $self->in_storage; # Don't reload if we aren't real!
+ $attrs = { force_pool => 'master', %{ defined $attrs ? $attrs:{} } };
if( my $current_storage = $self->get_from_storage($attrs)) {
# Set $self to the current.
eval "use DBIx::Class::Storage::DBI::Replicated; use Test::Moose";
plan $@
? ( skip_all => "Deps not installed: $@" )
- : ( tests => 126 );
+ : ( tests => 132 );
}
use_ok 'DBIx::Class::Storage::DBI::Replicated::Pool';
is $debug{storage_type}, 'MASTER', "got last query from a master: $debug{dsn}";
+ ok $artist->discard_changes({force_pool=>'master'})
+ => 'properly called discard_changes against master (manual attrs)';
+
+ is $debug{storage_type}, 'MASTER', "got last query from a master: $debug{dsn}";
+
+ ok $artist->discard_changes()
+ => 'properly called discard_changes against master (default attrs)';
+
+ is $debug{storage_type}, 'MASTER', "got last query from a master: $debug{dsn}";
+
+ ok $artist->discard_changes({force_pool=>$replicant_names[0]})
+ => 'properly able to override the default attributes';
+
+ is $debug{storage_type}, 'REPLICANT', "got last query from a replicant: $debug{dsn}"
}
## Test some edge cases, like trying to do a transaction inside a transaction, etc