Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed help test, minor doc corrections

  • Loading branch information...
commit c050beb260ee40c2676aeb46d8572562d7a500d8 1 parent dc1ef6e
@jjn1056 authored
View
1  lib/DBIx/Class/Migration/Script.pm
@@ -153,6 +153,7 @@ sub cmd_help {
my $docs = "DBIx::Class::Migration::Script::Help" . ($subhelp ? "::$subhelp" : "");
Pod::Usage::pod2usage(
-verbose => 2,
+ -exitval => 'NOEXIT',
-input => Pod::Find::pod_where({-inc => 1}, $docs));
}
View
88 lib/DBIx/Class/Migration/Script/Help/install.pod
@@ -0,0 +1,88 @@
+=head1 NAME
+
+DBIx::Class::Migration::Script::Help::install - Install a migration version
+
+=head1 SYNOPSIS
+
+ dbic-migration install --schema_class MyApp::Schema --to_version 2
+
+=head1 DESCRIPTION
+
+Installs either the current schema version (if already prepared) or the target
+version specified via L</to_version> to the database connected via the L</dsn>,
+L</username> and L</password>
+
+=head1 OPTIONS
+
+This command accepts the following options. You may learn more about each
+option by typing C<dbic-migration help OPTION>. The following is a summary.
+
+Format is "canonical (@aliases)".
+
+=head2 includes (I,lib,libs,include)
+
+Optional.
+
+Adds the listed paths to @INC. Handy during development when you want to use
+a development schema class.
+
+=head2 schema_class (S)
+
+Accepts Str. Required.
+
+This is the schema we use as the basis for creating, managing and running your
+deployments. This should be the full package namespace defining your subclass
+of L<DBIx::Class::Schema>. For example C<MyApp::Schema>.
+
+If the L</schema_class> cannot be loaded, a hard exception will be thrown.
+
+=head2 force_overwrite (O)
+
+Optional.
+
+Usually if you've already prepared migration files for the current version as
+specified in your L</schema_class> we don't write out files even if you call
+C<prepare>. If you want to force overwrite previously prepared files (and lose
+all your customizations) you can do so with this option.
+
+This option won't overwrite previously existing fixture configuration files.
+
+=head2 target_dir (D)
+
+Optional.
+
+When using a C<sandbox_class> for generating developer level database sandboxes,
+you may wish to place the sandbox in a directory other than the default (which
+is under the C<share> directory off the project root).
+
+=head2 database
+
+Optional.
+Alias: databases
+Value: Str or Array of Str (default: SQLite)
+
+By default we create migrations for SQLite. You can use this option to change
+that default, or to write our migrations for more than one database
+
+You can prepare deployment for any database type that L<SQLT> understands.
+
+ dbic-migration prepare --database SQLite --database mysql
+
+Please note if you choose to manually set this value, you won't automatically
+get the default, unless you specify as above.
+
+=head1 SEE ALSO
+
+L<DBIx::Class::Migration>, L<DBIx::Class::Migration::Script>,
+L<DBIx::Class::Migration::Features>, L<DBIx::Class::Migration::Tutorial>
+
+=head1 AUTHOR
+
+See L<DBIx::Class::Migration> for author information
+
+=head1 COPYRIGHT & LICENSE
+
+See L<DBIx::Class::Migration> for copyright and license information
+
+=cut
+
View
14 lib/DBIx/Class/Migration/Script/Help/prepare.pod
@@ -1,6 +1,6 @@
=head1 NAME
-DBIx::Class::Migration::Script::Help::Prepare - Create migration files.
+DBIx::Class::Migration::Script::Help::prepare - Create migration files.
=head1 SYNOPSIS
@@ -25,7 +25,7 @@ safety reasons, we never overwrite any fixture configs.
=head1 OPTIONS
This command accepts the following options. You may learn more about each
-option by typing C<dbic-migration help OPTION>
+option by typing C<dbic-migration help OPTION>. The following is a summary.
Format is "canonical (@aliases)".
@@ -36,6 +36,16 @@ Optional.
Adds the listed paths to @INC. Handy during development when you want to use
a development schema class.
+=head2 schema_class (S)
+
+Accepts Str. Required.
+
+This is the schema we use as the basis for creating, managing and running your
+deployments. This should be the full package namespace defining your subclass
+of L<DBIx::Class::Schema>. For example C<MyApp::Schema>.
+
+If the L</schema_class> cannot be loaded, a hard exception will be thrown.
+
=head2 force_overwrite (O)
Optional.
View
16 t/help.t
@@ -1,17 +1,15 @@
#!/usr/bin/env perl
use Test::Most;
-use Test::Requires 'Test::Trap';
+use Test::Requires 'Capture::Tiny';
use DBIx::Class::Migration::Script;
-sub run_cli {
- DBIx::Class::Migration::Script->run_with_options(@_);
-}
+ok(my $r = Capture::Tiny::capture_stdout {
+ DBIx::Class::Migration::Script->run_with_options(argv =>["help"]);
+});
-my @r = trap { run_cli(argv =>["help"]); };
-
-like $trap->stdout,
- qr/^Commands:.*^\s+help:.*^\s+version:.*^\s+status:/sm,
- 'help command produces output';
+like $r,
+ qr/DBIx::Class::Migration::Script::Help - Summary of the commands/sm,
+ 'help command produces expected output';
done_testing;
Please sign in to comment.
Something went wrong with that request. Please try again.