Merge remote branch 'origin/model-from-args'
[catagits/Gitalist.git] / t / lib / TestModelFancy.pm
diff --git a/t/lib/TestModelFancy.pm b/t/lib/TestModelFancy.pm
new file mode 100644 (file)
index 0000000..940b60f
--- /dev/null
@@ -0,0 +1,24 @@
+use MooseX::Declare;
+
+class TestModelFancy with Gitalist::Git::CollectionOfRepositories {
+    use MooseX::Types::Path::Class qw/Dir/;
+
+    has fanciness => (
+        is  => 'ro',
+        isa => 'Bool',
+    );
+
+    has repo_dir => (
+        isa      => Dir,
+        is       => 'ro',
+        required => 1,
+        coerce   => 1,
+    );
+
+    method _build_repositories {
+        [$self->get_repository('repo1')]
+    }
+    method _get_repo_from_name($name) {
+        Gitalist::Git::Repository->new($self->repo_dir->subdir($name)->resolve);
+    }
+}