Permalink
Browse files

Made all tests use strict, removed t/c/journal.t (leftover from old d…

…ays)
  • Loading branch information...
1 parent 74f3581 commit 1dd73210c613e7e3f6e9e2a37920da076ae1a7f4 @dandv dandv committed Dec 1, 2009
View
@@ -1,3 +1,6 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
use Test::More;
eval "use Test::Pod 1.14";
View
@@ -1,3 +1,6 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
use Test::More;
eval "use Test::Pod::Coverage 1.04";
View
@@ -1,3 +1,4 @@
+#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
@@ -11,4 +12,4 @@ my ($response, $c) = ctx_request('/');
isa_ok( $c, 'MojoMojo');
ok( request('/')->is_success, 'Request should succeed' );
-done_testing();
+done_testing();
View
@@ -1,3 +1,4 @@
+#!/usr/bin/env perl
use strict;
use warnings;
use HTTP::Request::Common;
View
@@ -1,11 +1,15 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+use strict;
+use warnings;
use Test::More tests => 29;
use Test::Differences;
+
BEGIN{
$ENV{CATALYST_CONFIG} = 't/var/mojomojo.yml';
};
-use_ok('Test::WWW::Mechanize::Catalyst', 'MojoMojo' );
-use_ok('MojoMojo::Controller::Attachment');
+
+use_ok( 'Test::WWW::Mechanize::Catalyst', 'MojoMojo' );
+use_ok( 'MojoMojo::Controller::Attachment' );
my $mech = Test::WWW::Mechanize::Catalyst->new;
my $file_to_upload = $0;
View
@@ -1,3 +1,4 @@
+#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
View
@@ -1,10 +1,14 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+use strict;
+use warnings;
use Test::More tests => 4;
+
BEGIN{
$ENV{CATALYST_CONFIG} = 't/var/mojomojo.yml';
};
-use_ok( Catalyst::Test, 'MojoMojo' );
-use_ok('MojoMojo::Controller::Comment');
+
+use_ok( 'Catalyst::Test', 'MojoMojo' );
+use_ok( 'MojoMojo::Controller::Comment' );
ok( request('/.comment')->is_success,'get .comment');
ok( request('/.comment/login')->is_success,'get .comment/login' );
View
@@ -1,3 +1,4 @@
+#!/usr/bin/env perl
use strict;
use warnings;
use Test::More tests => 14;
@@ -69,4 +70,3 @@ is( Email::Send::Test->emails, 1, 'regisration validation email sent' );
($mail) = Email::Send::Test->emails;
like( $mail->header('To'), qr/^mojam/, 'right recipient' );
like( $mail->body, qr/validate your email address/i, 'email contains validate email address' );
-
View
@@ -1,9 +0,0 @@
-#!/usr/bin/perl -w
-use Test::More tests => 2;
-BEGIN{
- $ENV{CATALYST_CONFIG} = 't/var/mojomojo.yml';
-};
-use_ok( Catalyst::Test, 'MojoMojo' );
-use_ok('MojoMojo::Controller::Journal');
-
-#ok( request('/.journal')->is_success );
View
@@ -1,16 +1,18 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+use strict;
+use warnings;
use Test::More tests => 5;
BEGIN {
$ENV{CATALYST_CONFIG} = 't/var/mojomojo.yml';
}
-use_ok( Catalyst::Test, 'MojoMojo' );
-use_ok('MojoMojo::Controller::Jsrpc');
+
+use_ok( 'Catalyst::Test', 'MojoMojo' );
+use_ok( 'MojoMojo::Controller::Jsrpc' );
my $req = request('/.jsrpc/render?content=123');
ok( $req->is_success );
-# Need to remove end of line character from content for comparsion.
-my $content = $req->content;
-chomp $content;
-is( $content, '<p>123</p>', 'correct body returned' );
+
+my $content = $req->content; # content ends with a LF
+is( $content, "<p>123</p>\n", 'correct body returned' );
ok( request('/.jsrpc/child_menu')->is_success );
View
@@ -1,10 +1,14 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+use strict;
+use warnings;
use Test::More tests => 14;
+
BEGIN{
$ENV{CATALYST_CONFIG} = 't/var/mojomojo.yml';
};
-use_ok( Catalyst::Test, 'MojoMojo' );
-use_ok('MojoMojo::Controller::Page');
+
+use_ok( 'Catalyst::Test', 'MojoMojo' );
+use_ok( 'MojoMojo::Controller::Page' );
ok( request('/.view')->is_success, 'view root' );
ok( request('/.inline_tags')->is_success, 'show inline tags' );
View
@@ -1,12 +1,14 @@
-#!/usr/bin/perl -w
-use Test::More ;
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+
BEGIN{
$ENV{CATALYST_CONFIG} = 't/var/mojomojo.yml';
};
BEGIN {
eval "use Test::WWW::Mechanize::Catalyst 'MojoMojo'";
-print $@;
plan skip_all => 'need Test::WWW::Mechanize::Catalyst' if $@;
eval "use WWW::Mechanize::TreeBuilder";
View
@@ -1,5 +1,8 @@
-#!/usr/bin/perl -w
-use Test::More ;
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+
BEGIN{
$ENV{CATALYST_CONFIG} = 't/var/mojomojo.yml';
};
@@ -58,14 +61,14 @@ ok( $mech->look_down(
# Create a page
$mech->get_ok('/test.edit', 'edit a test page');
ok $mech->form_with_fields('body'), 'find the edit form';
-ok defined $mech->field(body => <<PAGE_CONTENT,
+ok defined $mech->field(body => <<PAGE_CONTENT), 'set the "body" value';
# This is a test page
It was submitted via {{cpan Test::WWW::Mechanize::Catalyst}} with a random string of '$random'.
It also links to [[/|the root page]] and [[/help]] as well as a [[/totally_new_page]].
PAGE_CONTENT
-), 'set the "body" value';
+
# we should click 'Save and View' but that causes WWW::Mechanize to die with `Can't call method "header" on an undefined value at /usr/local/share/perl/5.8.8/WWW/Mechanize.pm line 2381`
ok $mech->click_button(value => 'Save'), 'click the "Save" button';
@@ -79,10 +82,10 @@ RENDERED_CONTENT
$mech->get_ok('/totally_new_page.edit', 'make the new page');
ok $mech->form_with_fields('body'), 'find the edit form';
-ok defined $mech->field(body => <<PAGE_CONTENT,
+ok defined $mech->field(body => <<PAGE_CONTENT), 'Set page content';
# This is a test page
PAGE_CONTENT
-),'Set page content';
+
ok $mech->click_button(value => 'Save'), 'click the "Save" button';
$mech->get_ok('/test');
View
@@ -1,4 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+use strict;
+use warnings;
use Test::More tests => 16;
BEGIN{
@@ -56,4 +58,3 @@ ok defined $cloud_class{baz}, 'saw baz tag';
ok $cloud_class{bar} > $cloud_class{baz}, 'bar > baz';
ok $cloud_class{foo} == $cloud_class{bar}, 'foo = bar';
-
View
@@ -1,3 +1,4 @@
+#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
View
@@ -1,5 +1,8 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+use strict;
+use warnings;
use Test::More tests => 13;
+
BEGIN{
$ENV{CATALYST_CONFIG} = 't/var/mojomojo.yml';
use_ok('Catalyst::Test', 'MojoMojo');
View
@@ -1,5 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
use strict;
+use warnings;
use MojoMojo::Formatter::Defang;
use Test::More tests => 11;
use Test::Differences;
View
@@ -1,3 +1,4 @@
+#!/usr/bin/env perl
use strict;
use warnings;
@@ -1,6 +1,7 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
# Comprehensive/chained test of formatters, with the main formatter set to MultiMarkdown
use strict;
+use warnings;
use Test::More tests => 27;
use HTTP::Request::Common;
use Test::Differences;
@@ -1,5 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
use strict;
+use warnings;
use Test::More tests => 32;
use HTTP::Request::Common;
use Test::Differences;
View
@@ -1,6 +1,8 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
use Test::More;
-
BEGIN {
use MojoMojo::Formatter::Amazon;
View
@@ -1,11 +1,14 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+use strict;
+use warnings;
use Test::More tests => 4;
+
BEGIN {
- $ENV{CATALYST_CONFIG}='t/var/mojomojo.yml';
+ $ENV{CATALYST_CONFIG} = 't/var/mojomojo.yml';
use_ok('MojoMojo::Formatter::Comment');
can_ok('MojoMojo::Formatter::Comment', qw/format_content format_content_order/);
- use_ok(Catalyst::Test, 'MojoMojo');
+ use_ok('Catalyst::Test', 'MojoMojo');
};
-$body = get('/.jsrpc/render?content=%7B%7Bcomments%7D%7D');
+my $body = get('/.jsrpc/render?content=%7B%7Bcomments%7D%7D');
like($body, qr/comments disabled for preview/, 'the comment formatter is recognized');
@@ -1,5 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
use strict;
+use warnings;
use MojoMojo::Formatter::CPANHyperlink;
use Test::More tests => 8;
View
@@ -1,5 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
use strict;
+use warnings;
use MojoMojo::Formatter::Defang;
use Test::More tests => 6;
use Test::Differences;
View
@@ -1,5 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
use strict;
+use warnings;
use Test::More;
BEGIN {
View
@@ -1,7 +1,8 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
use strict;
-use MojoMojo::Formatter::Include;
+use warnings;
use Test::More;
+use MojoMojo::Formatter::Include;
use lib 't/lib';
use FakeCatalystObject;
View
@@ -1,4 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+use strict;
+use warnings;
use Test::More tests => 8;
use MojoMojo::Formatter::IRCLog;
@@ -36,6 +38,3 @@ is($content, "$ob<dt>[[nick]]</dt>\n<dd>text more</dd>\n$oe", "multi-line");
$content = "${ib}12:00 <+nick> text\nmore$ie${ib}12:00 <+nick> text\nmore$ie";
MojoMojo::Formatter::IRCLog->format_content(\$content);
is($content, "$ob<dt>[[nick]]</dt>\n<dd>text more</dd>\n$oe$ob<dt>[[nick]]</dt>\n<dd>text more</dd>\n$oe", "multi-block");
-
-
-
View
@@ -1,7 +1,8 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
use strict;
-use MojoMojo::Formatter::Markdown;
+use warnings;
use Test::More tests => 15;
+use MojoMojo::Formatter::Markdown;
use Test::Differences;
my ( $content, $got, $expected, $test );
@@ -210,5 +211,3 @@ eq_or_diff( MojoMojo::Formatter::Markdown->main_format_content( \$content ),
<span class="caption">Caption</span></p>
</div>
HTML
-
-
View
@@ -1,4 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+use strict;
+use warnings;
use Test::More tests => 4;
use MojoMojo::Formatter::Redirect;
use lib 't/lib';
View
@@ -1,5 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
use strict;
+use warnings;
use MojoMojo::Formatter::RSS;
use Test::More;
use lib 't/lib';
@@ -1,5 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
use strict;
+use warnings;
use MojoMojo::Formatter::SyntaxHighlight;
use HTTP::Request::Common;
use Test::More;
@@ -229,4 +230,3 @@ PERL
PERL
is( $content, $wanted, $test );
}
-
View
@@ -1,5 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
use strict;
+use warnings;
use MojoMojo::Formatter::Textile;
use Test::More tests => 6;
use Test::Differences;
View
@@ -1,5 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
use strict;
+use warnings;
use MojoMojo::Formatter::TOC;
use Test::More tests => 8;
Oops, something went wrong.

0 comments on commit 1dd7321

Please sign in to comment.