initial external translator object and test
Matt S Trout [Fri, 6 Feb 2009 13:52:02 +0000 (08:52 -0500)]
lib/LolCatalyst/Lite/Translator.pm [new file with mode: 0644]
t/translator/simple.t [new file with mode: 0644]

diff --git a/lib/LolCatalyst/Lite/Translator.pm b/lib/LolCatalyst/Lite/Translator.pm
new file mode 100644 (file)
index 0000000..3aeb7de
--- /dev/null
@@ -0,0 +1,14 @@
+package LolCatalyst::Lite::Translator;
+
+use Moose;
+use Acme::LOLCAT ();
+use namespace::clean -except => 'meta';
+
+sub translate {
+  my ($self, $text) = @_;
+  return Acme::LOLCAT::translate($text);
+}
+
+__PACKAGE__->meta->make_immutable;
+
+1;
diff --git a/t/translator/simple.t b/t/translator/simple.t
new file mode 100644 (file)
index 0000000..6a3ab1d
--- /dev/null
@@ -0,0 +1,15 @@
+use strict;
+use warnings;
+use Test::More qw(no_plan);
+use LolCatalyst::Lite::Translator;
+
+ok(
+  (my $tr = LolCatalyst::Lite::Translator->new),
+  'Constructed translator object ok'
+);
+
+like(
+  $tr->translate('Can i have a cheese burger?'),
+  qr/CHEEZ/,
+  'String translated ok'
+);