--- /dev/null
+package LolCatalyst::Lite::SnippetStore;
+
+use Moose;
+use namespace::clean -except => 'meta';
+
+has '_snippets' => (is => 'ro', default => sub { [] });
+
+sub find {
+ my ($self, $id) = @_;
+ $self->_snippets->[$id - 1];
+}
+
+sub all {
+ my ($self) = @_;
+ @{$self->_snippets};
+}
+
+sub create {
+ my ($self, $new) = @_;
+ $new->{id} = @{$self->_snippets} + 1;
+ push(@{$self->_snippets}, $new);
+ $new;
+}
+
+__PACKAGE__->meta->make_immutable;
+
+1;
--- /dev/null
+use strict;
+use warnings;
+use Test::More qw(no_plan);
+
+use_ok "LolCatalyst::Lite::SnippetStore";
+
+my $store = LolCatalyst::Lite::SnippetStore->new;
+
+my $num_snips = 3;
+
+ok(
+ (my @snip = map $store->create({ text => "snippet $_" }), 1 .. $num_snips),
+ 'Creates ok'
+);
+
+cmp_ok(scalar(@snip), '==', $num_snips, "$num_snips created");
+
+is_deeply(\@snip, [ $store->all ], 'deep snippet check');
+
+foreach my $snip (@snip) {
+ my $id = $snip->{id};
+ is($snip->{text}, $store->find($id)->{text}, "find by id $id ok");
+}