From: Norbert Buchmuller Date: Wed, 18 Mar 2009 22:34:23 +0000 (+0000) Subject: Simple test of coercion on quote_char accessor X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8eda21196311c23bea702199e7ea994d8da58aec;p=dbsrgits%2FSQL-Abstract-2.0-ish.git Simple test of coercion on quote_char accessor --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index e04c863..18e799b 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -77,7 +77,6 @@ class SQL::Abstract { is => 'rw', isa => NameSeparator, default => '.', - coerece => 1, required => 1, ); @@ -91,9 +90,9 @@ class SQL::Abstract { has quote_chars => ( is => 'rw', isa => QuoteChars, - coerece => 1, predicate => 'is_quoting', clearer => 'disable_quoting', + coerce => 1, ); has binds => ( diff --git a/t/003_quote.t b/t/003_quote.t new file mode 100644 index 0000000..61df9dc --- /dev/null +++ b/t/003_quote.t @@ -0,0 +1,13 @@ +use strict; +use warnings; + +use Test::More tests => 2; +use Test::Exception; + +use_ok('SQL::Abstract') or BAIL_OUT( "$@" ); + +my $sqla = SQL::Abstract->create(1); + +lives_ok { + $sqla->quote_chars('[]'); +} "coercion of quote_chars from Str works";