When emulating $obj->{column} do not call any custom column method, just
[dbsrgits/DBIx-Class.git] / t / cdbi-t / columns_as_hashes.t
index 4e39cb7..1280f6f 100644 (file)
@@ -7,7 +7,7 @@ use Test::Warn;
 BEGIN {
   eval "use DBIx::Class::CDBICompat;";
   plan $@ ? (skip_all => "Class::Trigger and DBIx::ContextualFetch required: $@")
-          : (tests=> 9);
+          : (tests=> 10);
 }
 
 use lib 't/testlib';
@@ -50,4 +50,19 @@ is @films, 1, "column updated as hash was saved";
 warning_is {
     local $ENV{DBIC_CDBICOMPAT_HASH_WARN} = 0;
     $waves->{rating}
-} '', 'DBIC_CDBICOMPAT_HASH_WARN controls warnings';
\ No newline at end of file
+} '', 'DBIC_CDBICOMPAT_HASH_WARN controls warnings';
+
+
+{
+    local $ENV{DBIC_CDBICOMPAT_HASH_WARN} = 0;
+    
+    $waves->rating("R");
+    $waves->update;
+    
+    no warnings 'redefine';
+    local *Film::rating = sub {
+        return "wibble";
+    };
+    
+    is $waves->{rating}, "R";
+}