rename Shim to ProducerUtils for accuracy
Arthur Axel 'fREW' Schmidt [Mon, 2 May 2011 23:25:03 +0000 (18:25 -0500)]
lib/SQL/Translator/Producer/SQLServer.pm
lib/SQL/Translator/ProducerUtils.pm [moved from lib/SQL/Translator/Shim.pm with 96% similarity]
t/65-producerutils.t [new file with mode: 0644]
t/65-shim.t [deleted file]

index 29058ba..bbd46da 100644 (file)
@@ -60,9 +60,9 @@ $DEBUG = 1 unless defined $DEBUG;
 use Data::Dumper;
 use SQL::Translator::Schema::Constants;
 use SQL::Translator::Utils qw(debug header_comment);
-use SQL::Translator::Shim;
+use SQL::Translator::ProducerUtils;
 
-my $shim = SQL::Translator::Shim->new( quote_chars => ['[', ']'] );
+my $util = SQL::Translator::ProducerUtils->new( quote_chars => ['[', ']'] );
 
 my %translate  = (
     date      => 'datetime',
@@ -403,7 +403,7 @@ sub mk_name {
 }
 
 # -------------------------------------------------------------------
-sub unreserve { $shim->quote($_[0]) }
+sub unreserve { $util->quote($_[0]) }
 
 1;
 
similarity index 96%
rename from lib/SQL/Translator/Shim.pm
rename to lib/SQL/Translator/ProducerUtils.pm
index b9b3b5f..f90ff3a 100644 (file)
@@ -1,4 +1,4 @@
-package SQL::Translator::Shim;
+package SQL::Translator::ProducerUtils;
 
 use Moo;
 use Sub::Quote 'quote_sub';
diff --git a/t/65-producerutils.t b/t/65-producerutils.t
new file mode 100644 (file)
index 0000000..3e1c93c
--- /dev/null
@@ -0,0 +1,27 @@
+use strict;
+use warnings;
+
+use Test::More;
+
+use SQL::Translator::ProducerUtils;
+
+my $util = SQL::Translator::ProducerUtils->new(
+   quote_chars => ['[', ']'],
+);
+
+is $util->quote('frew'), '[frew]', 'simple quote works';
+is $util->quote('people.frew'), '[people].[frew]', 'namespaced quote works';
+
+my $single_util = SQL::Translator::ProducerUtils->new(
+   quote_chars => q(|),
+);
+
+is $single_util->quote('frew'), '|frew|', 'simple single quote works';
+is $single_util->quote('people.frew'), '|people|.|frew|', 'namespaced single quote works';
+
+my $no_util = SQL::Translator::ProducerUtils->new();
+
+is $no_util->quote('frew'), 'frew', 'simple no quote works';
+is $no_util->quote('people.frew'), 'people.frew', 'namespaced no quote works';
+
+done_testing;
diff --git a/t/65-shim.t b/t/65-shim.t
deleted file mode 100644 (file)
index 23545c5..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-use strict;
-use warnings;
-
-use Test::More;
-
-use SQL::Translator::Shim;
-
-my $shim = SQL::Translator::Shim->new(
-   quote_chars => ['[', ']'],
-);
-
-is $shim->quote('frew'), '[frew]', 'simple quote works';
-is $shim->quote('people.frew'), '[people].[frew]', 'namespaced quote works';
-
-my $single_shim = SQL::Translator::Shim->new(
-   quote_chars => q(|),
-);
-
-is $single_shim->quote('frew'), '|frew|', 'simple single quote works';
-is $single_shim->quote('people.frew'), '|people|.|frew|', 'namespaced single quote works';
-
-my $no_shim = SQL::Translator::Shim->new();
-
-is $no_shim->quote('frew'), 'frew', 'simple no quote works';
-is $no_shim->quote('people.frew'), 'people.frew', 'namespaced no quote works';
-
-done_testing;