Skip to content
This repository has been archived by the owner on Apr 22, 2021. It is now read-only.

Commit

Permalink
Add more tests for subcommands
Browse files Browse the repository at this point in the history
  • Loading branch information
mdom committed Feb 22, 2016
1 parent 257fc67 commit 4a797aa
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,42 @@ like( $twtfile->slurp_utf8, qr/[\d:TZ-]+\tHello World/ );
stdout_is( sub { $app->run( 'follow', 'bob', '/bob.txt' ) },
qq{You're already following bob.\n} );

stdout_is(
sub { $app->run( 'follow', 'bob', '/bob2.0.txt' ) },
qq{You're already following bob under a differant url.\n}
);

stdout_is( sub { $app->run( 'unfollow', 'bob' ) },
qq{You've unfollowed bob.\n} );

stdout_is(
sub { $app->run( 'unfollow', 'charlie' ) },
qq{You're not following charlie.\n}
);

stdout_is( sub { $app->run('following') }, qq{alice @ /alice.txt\n} );

stdout_is( sub { $app->run( 'follow', 'bob', '/bob.txt' ) },
qq{You're now following bob.\n} );

stdout_is(
sub { $app->run( 'config', 'get', 'disclose_identity' ) },
qq{The configuration key disclose_identity is unset.\n}
);

ok( not exists $app->config->read_file->{twtxt}->{disclose_identity} );

stdout_is( sub { $app->run( 'config', 'set', 'disclose_identity', 1 ) }, qq{} );

is( $app->config->read_file->{twtxt}->{disclose_identity}, 1 );

stdout_is( sub { $app->run( 'config', 'get', 'disclose_identity' ) }, qq{1\n} );

stdout_is( sub { $app->run( 'config', 'remove', 'disclose_identity' ) }, qq{} );

stdout_is(
sub { $app->run( 'config', 'get', 'disclose_identity' ) },
qq{The configuration key disclose_identity is unset.\n}
);

done_testing;

0 comments on commit 4a797aa

Please sign in to comment.