Permalink
Browse files

Fix test failures due to project URI integration.

  • Loading branch information...
1 parent 47ee742 commit 25af37f2969545afd79a6e00055945e537851750 @theory committed Jun 14, 2012
Showing with 14 additions and 3 deletions.
  1. +1 −0 lib/App/Sqitch/Command/init.pm
  2. +4 −1 t/config.t
  3. +1 −0 t/configuration.t
  4. +1 −0 t/init.t
  5. +6 −1 t/pg.t
  6. +1 −1 t/step.t
@@ -70,6 +70,7 @@ sub write_config {
# Start with a URI.
my $uri = try { $sqitch->uri } || do {
require UUID::Tiny;
+ require URI;
URI->new(
'urn:uuid:' . UUID::Tiny::create_uuid_as_string(UUID::Tiny::UUID_V4())
);
View
@@ -442,6 +442,7 @@ core.pg.username=postgres
core.sql_dir=migrations
core.sqlite.client=/opt/local/bin/sqlite3
core.sqlite.sqitch_prefix=meta
+core.uri=https://github.com/theory/sqitch/
revert.count=2
revert.revision=1.1
revert.to=gamma
@@ -469,6 +470,7 @@ core.extension=ddl
core.pg.client=/usr/local/pgsql/bin/psql
core.pg.username=theory
core.sql_dir=migrations
+core.uri=https://github.com/theory/sqitch/
revert.count=2
revert.revision=1.1
revert.to=gamma
@@ -755,7 +757,8 @@ core.foo=[bar, baz]
core.pg.client=/usr/local/pgsql/bin/psql
core.pg.user=theory
core.pg.username=theory
-core.sql_dir=migrations}
+core.sql_dir=migrations
+core.uri=https://github.com/theory/sqitch/}
]], 'Should match all core options';
@emit = ();
View
@@ -62,6 +62,7 @@ is_deeply $config->get_section(section => 'core'), {
engine => "pg",
extension => "ddl",
sql_dir => "migrations",
+ uri => 'https://github.com/theory/sqitch/',
}, 'get_section("core") should work';
is_deeply $config->get_section(section => 'core.pg'), {
View
@@ -201,6 +201,7 @@ SYSTEMCONF: {
'core.uri' => $uri,
'core.extension' => 'foo',
'core.engine' => 'pg',
+ 'core.uri' => URI->new('https://github.com/theory/sqitch/'),
}, 'The configuration should have local and system config';
is_deeply +MockOutput->get_info, [
['Created ' . $conf_file]
View
7 t/pg.t
@@ -11,6 +11,7 @@ use Capture::Tiny qw(:all);
use Try::Tiny;
use App::Sqitch;
use App::Sqitch::Plan;
+use URI;
my $CLASS;
@@ -31,7 +32,9 @@ is_deeply [$CLASS->config_vars], [
sqitch_schema => 'any',
], 'config_vars should return three vars';
-my $sqitch = App::Sqitch->new;
+my $sqitch = App::Sqitch->new(
+ uri => URI->new('https://github.com/theory/sqitch/'),
+);
isa_ok my $pg = $CLASS->new(sqitch => $sqitch), $CLASS;
my $client = 'psql' . ($^O eq 'Win32' ? '.exe' : '');
@@ -117,6 +120,7 @@ $sqitch = App::Sqitch->new(
'db_name' => 'widgets_dev',
'host' => 'foo.com',
'port' => 98760,
+ uri => URI->new('https://github.com/theory/sqitch/'),
);
ok $pg = $CLASS->new(sqitch => $sqitch), 'Create a pg with sqitch with options';
@@ -226,6 +230,7 @@ subtest 'live database' => sub {
username => 'postgres',
sql_dir => Path::Class::dir(qw(t pg)),
plan_file => Path::Class::file(qw(t pg sqitch.plan)),
+ uri => URI->new('https://github.com/theory/sqitch/'),
);
$pg = $CLASS->new(sqitch => $sqitch);
try {
View
@@ -92,7 +92,7 @@ ok $step = $CLASS->new(
is $step->as_string, " - howdy\t# blah blah blah",
'It should stringify correctly';
my $mock_plan = Test::MockModule->new(ref $plan);
-$mock_plan->mock(index_of => 0);
+$mock_plan->mock(index_of => 0);
ok !$step->is_deploy, 'It should not be a deploy step';
ok $step->is_revert, 'It should be a revert step';

0 comments on commit 25af37f

Please sign in to comment.