Skip to content

Commit

Permalink
removed a few obsolete tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 7, 2012
1 parent 5a6d37c commit 47f4c83
Show file tree
Hide file tree
Showing 48 changed files with 171 additions and 183 deletions.
1 change: 1 addition & 0 deletions Changes
Expand Up @@ -4,6 +4,7 @@ This file documents the revision history for Perl extension Mojolicious.
- Added support for MOJO_LISTEN environment variable.
- Removed listen attribute from Mojo::Server::Morbo.
- Improved documentation.
- Improved tests.
- Fixed bug in Hypnotoad that prevented disabling of reverse proxy
support between zero downtime software upgrades.
- Fixed small caching bug in Morbo file watcher.
Expand Down
4 changes: 1 addition & 3 deletions lib/Mojolicious/Command/generate/app.pm
Expand Up @@ -128,11 +128,9 @@ sub welcome {
% my $class = shift;
use Mojo::Base -strict;
use Test::More tests => 4;
use Test::More tests => 3;
use Test::Mojo;
use_ok '<%= $class %>';
my $t = Test::Mojo->new('<%= $class %>');
$t->get_ok('/')->status_is(200)->content_like(qr/Mojolicious/i);
Expand Down
7 changes: 3 additions & 4 deletions t/mojo/app.t
Expand Up @@ -6,20 +6,19 @@ BEGIN {
$ENV{MOJO_IOWATCHER} = 'Mojo::IOWatcher';
}

use Test::More tests => 56;
use Test::More tests => 54;

# "I was so bored I cut the pony tail off the guy in front of us.
# Look at me, I'm a grad student.
# I'm 30 years old and I made $600 last year.
# Bart, don't make fun of grad students.
# They've just made a terrible life choice."
use Mojo;
use Mojo::IOLoop;
use Mojo::Server::Daemon;
use Mojo::Transaction::HTTP;
use Mojo::UserAgent;

use_ok 'Mojo';
use_ok 'Mojolicious';
use Mojolicious;

# Timeout
{
Expand Down
6 changes: 3 additions & 3 deletions t/mojo/asset.t
@@ -1,13 +1,13 @@
use Mojo::Base -strict;

use Test::More tests => 65;
use Test::More tests => 63;

# "And now, in the spirit of the season: start shopping.
# And for every dollar of Krusty merchandise you buy,
# I will be nice to a sick kid.
# For legal purposes, sick kids may include hookers with a cold."
use_ok 'Mojo::Asset::File';
use_ok 'Mojo::Asset::Memory';
use Mojo::Asset::File;
use Mojo::Asset::Memory;

# File asset
my $file = Mojo::Asset::File->new;
Expand Down
10 changes: 5 additions & 5 deletions t/mojo/base.t
@@ -1,6 +1,6 @@
use Mojo::Base -strict;

use Test::More tests => 413;
use Test::More tests => 409;

use FindBin;
use lib "$FindBin::Bin/lib";
Expand All @@ -19,10 +19,10 @@ __PACKAGE__->attr('name');

package main;

use_ok 'Mojo::Base';
use_ok 'BaseTest::Base1';
use_ok 'BaseTest::Base2';
use_ok 'BaseTest::Base3';
use Mojo::Base;
use BaseTest::Base1;
use BaseTest::Base2;
use BaseTest::Base3;

# Basic functionality
my $monkeys = [];
Expand Down
7 changes: 3 additions & 4 deletions t/mojo/bytestream.t
Expand Up @@ -5,14 +5,13 @@ use utf8;
# "Homer, we're going to ask you a few simple yes or no questions.
# Do you understand?
# Yes. *lie dectector blows up*"
use Test::More tests => 141;
use Test::More tests => 139;

# Need to be loaded first to trigger edge case
use MIME::Base64;
use MIME::QuotedPrint;

use_ok 'Mojo::Util', 'md5_bytes';
use_ok 'Mojo::ByteStream', 'b';
use Mojo::Util 'md5_bytes';
use Mojo::ByteStream 'b';

# camelize
my $stream = b('foo_bar_baz');
Expand Down
4 changes: 2 additions & 2 deletions t/mojo/cache.t
@@ -1,10 +1,10 @@
use Mojo::Base -strict;

use Test::More tests => 21;
use Test::More tests => 20;

# "You know, most people pray silently.
# Marge He's way the hell up there."
use_ok 'Mojo::Cache';
use Mojo::Cache;

my $cache = Mojo::Cache->new(max_keys => 2);
$cache->set(foo => 'bar');
Expand Down
11 changes: 5 additions & 6 deletions t/mojo/cgi.t
@@ -1,15 +1,14 @@
use Mojo::Base -strict;

use Test::More tests => 20;

use Mojo::Message::Response;
use Mojolicious::Lite;
use Test::More tests => 18;

# "My ears are burning.
# I wasn't talking about you, Dad.
# No, my ears are really burning. I wanted to see inside, so I lit a Q-tip."
use_ok 'Mojo::Server::CGI';
use_ok 'Mojolicious::Command::cgi';
use Mojo::Message::Response;
use Mojo::Server::CGI;
use Mojolicious::Command::cgi;
use Mojolicious::Lite;

# Silence
app->log->level('fatal');
Expand Down
4 changes: 2 additions & 2 deletions t/mojo/collection.t
@@ -1,9 +1,9 @@
use Mojo::Base -strict;

use Test::More tests => 51;
use Test::More tests => 50;

# "'What are you lookin at?' - the innocent words of a drunken child."
use_ok 'Mojo::Collection', 'c';
use Mojo::Collection 'c';

# Array
is c(1, 2, 3)->[1], 2, 'right result';
Expand Down
7 changes: 3 additions & 4 deletions t/mojo/command.t
@@ -1,13 +1,12 @@
use Mojo::Base -strict;

use Test::More tests => 32;
use Test::More tests => 31;

# "My cat's breath smells like cat food."
use Cwd 'cwd';
use File::Spec::Functions 'catdir';
use File::Temp;

# "My cat's breath smells like cat food."
use_ok 'Mojo::Command';
use Mojo::Command;

my $command = Mojo::Command->new;

Expand Down
6 changes: 3 additions & 3 deletions t/mojo/content.t
@@ -1,11 +1,11 @@
use Mojo::Base -strict;

use Test::More tests => 19;
use Test::More tests => 17;

# "No matter how good you are at something,
# there's always about a million people better than you."
use_ok 'Mojo::Content::MultiPart';
use_ok 'Mojo::Content::Single';
use Mojo::Content::MultiPart;
use Mojo::Content::Single;

# Single
my $content = Mojo::Content::Single->new;
Expand Down
6 changes: 3 additions & 3 deletions t/mojo/cookie.t
@@ -1,10 +1,10 @@
use Mojo::Base -strict;

use Test::More tests => 184;
use Test::More tests => 182;

# "What good is money if it can't inspire terror in your fellow man?"
use_ok 'Mojo::Cookie::Request';
use_ok 'Mojo::Cookie::Response';
use Mojo::Cookie::Request;
use Mojo::Cookie::Response;

# Request cookie as string
my $cookie = Mojo::Cookie::Request->new;
Expand Down
5 changes: 2 additions & 3 deletions t/mojo/cookiejar.t
@@ -1,15 +1,14 @@
use Mojo::Base -strict;

use Test::More tests => 86;
use Test::More tests => 85;

# "Hello, my name is Mr. Burns. I believe you have a letter for me.
# Okay Mr. Burns, what’s your first name.
# I don’t know."
use Mojo::Cookie::Response;
use Mojo::CookieJar;
use Mojo::URL;

use_ok 'Mojo::CookieJar';

# Session cookie
my $jar = Mojo::CookieJar->new;
$jar->add(
Expand Down
46 changes: 23 additions & 23 deletions t/mojo/date.t
@@ -1,9 +1,9 @@
use Mojo::Base -strict;

use Test::More tests => 21;
use Test::More tests => 20;

# "Can't we have one meeting that doesn't end with digging up a corpse?"
use_ok 'Mojo::Date';
use Mojo::Date;

# RFC 822/1123
my $date = Mojo::Date->new('Sun, 06 Nov 1994 08:49:37 GMT');
Expand All @@ -12,29 +12,29 @@ $date = Mojo::Date->new('Fri, 13 May 2011 10:00:24 GMT');
is $date->epoch, 1305280824, 'right epoch value';

# RFC 850/1036
is Mojo::Date->new('Sunday, 06-Nov-94 08:49:37 GMT')->epoch,
784111777, 'right epoch value';
is Mojo::Date->new('Friday, 13-May-11 10:00:24 GMT')->epoch,
1305280824, 'right epoch value';
is(Mojo::Date->new('Sunday, 06-Nov-94 08:49:37 GMT')->epoch,
784111777, 'right epoch value');
is(Mojo::Date->new('Friday, 13-May-11 10:00:24 GMT')->epoch,
1305280824, 'right epoch value');

# ANSI C asctime()
is Mojo::Date->new('Sun Nov 6 08:49:37 1994')->epoch,
784111777, 'right epoch value';
is Mojo::Date->new('Fri May 13 10:00:24 2011')->epoch,
1305280824, 'right epoch value';
is(Mojo::Date->new('Sun Nov 6 08:49:37 1994')->epoch,
784111777, 'right epoch value');
is(Mojo::Date->new('Fri May 13 10:00:24 2011')->epoch,
1305280824, 'right epoch value');

# Invalid string
is Mojo::Date->new('')->epoch, undef, 'no epoch value';
is Mojo::Date->new('123 abc')->epoch, undef, 'no epoch value';
is Mojo::Date->new('abc')->epoch, undef, 'no epoch value';
is Mojo::Date->new('Xxx, 00 Xxx 0000 00:00:00 XXX')->epoch, undef,
'no epoch value';
is Mojo::Date->new('Sun, 06 Nov 1994 08:49:37 GMT GARBAGE')->epoch, undef,
'no epoch value';
is Mojo::Date->new('Sunday, 06-Nov-94 08:49:37 GMT GARBAGE')->epoch, undef,
'no epoch value';
is Mojo::Date->new('Sun Nov 6 08:49:37 1994 GARBAGE')->epoch, undef,
'no epoch value';
is(Mojo::Date->new('')->epoch, undef, 'no epoch value');
is(Mojo::Date->new('123 abc')->epoch, undef, 'no epoch value');
is(Mojo::Date->new('abc')->epoch, undef, 'no epoch value');
is(Mojo::Date->new('Xxx, 00 Xxx 0000 00:00:00 XXX')->epoch,
undef, 'no epoch value');
is(Mojo::Date->new('Sun, 06 Nov 1994 08:49:37 GMT GARBAGE')->epoch,
undef, 'no epoch value');
is(Mojo::Date->new('Sunday, 06-Nov-94 08:49:37 GMT GARBAGE')->epoch,
undef, 'no epoch value');
is(Mojo::Date->new('Sun Nov 6 08:49:37 1994 GARBAGE')->epoch,
undef, 'no epoch value');

# to_string
$date = Mojo::Date->new(784111777);
Expand All @@ -46,8 +46,8 @@ is $date->to_string, 'Fri, 13 May 2011 10:00:24 GMT', 'right format';
$date = Mojo::Date->new(0);
is $date->epoch, 0, 'right epoch value';
is "$date", 'Thu, 01 Jan 1970 00:00:00 GMT', 'right format';
is Mojo::Date->new('Thu, 01 Jan 1970 00:00:00 GMT')->epoch,
0, 'right epoch value';
is(Mojo::Date->new('Thu, 01 Jan 1970 00:00:00 GMT')->epoch,
0, 'right epoch value');

# Negative epoch value
$date = Mojo::Date->new;
Expand Down
7 changes: 3 additions & 4 deletions t/mojo/delay.t
Expand Up @@ -6,13 +6,12 @@ BEGIN {
$ENV{MOJO_IOWATCHER} = 'Mojo::IOWatcher';
}

use Test::More tests => 7;

use Mojo::IOLoop;
use Test::More tests => 6;

# "And now to create an unstoppable army of between one million and two
# million zombies!"
use_ok 'Mojo::IOLoop::Delay';
use Mojo::IOLoop;
use Mojo::IOLoop::Delay;

# Minimal
my $delay = Mojo::IOLoop::Delay->new;
Expand Down
9 changes: 4 additions & 5 deletions t/mojo/dom.t
Expand Up @@ -2,14 +2,13 @@ use Mojo::Base -strict;

use utf8;

use Test::More tests => 727;

use ojo;
use Mojo::Util 'encode';
use Test::More tests => 726;

# "Homer gave me a kidney: it wasn't his, I didn't need it,
# and it came postage due- but I appreciated the gesture!"
use_ok 'Mojo::DOM';
use ojo;
use Mojo::DOM;
use Mojo::Util 'encode';

# ojo
is x('<div>Hello ♥!</div>')->at('div')->text, 'Hello ♥!', 'right text';
Expand Down
4 changes: 2 additions & 2 deletions t/mojo/eventemitter.t
@@ -1,9 +1,9 @@
use Mojo::Base -strict;

use Test::More tests => 47;
use Test::More tests => 46;

# "Hi, Super Nintendo Chalmers!"
use_ok 'Mojo::EventEmitter';
use Mojo::EventEmitter;

# Normal event
my $e = Mojo::EventEmitter->new;
Expand Down
4 changes: 2 additions & 2 deletions t/mojo/headers.t
@@ -1,12 +1,12 @@
use Mojo::Base -strict;

# "Remember, you can always find East by staring directly at the sun."
use Test::More tests => 88;
use Test::More tests => 87;

# "So, have a merry Christmas, a happy Hanukkah, a kwaazy Kwanza,
# a tip-top Tet, and a solemn, dignified, Ramadan.
# And now a word from MY god, our sponsors!"
use_ok 'Mojo::Headers';
use Mojo::Headers;

# Basic functionality
my $headers = Mojo::Headers->new;
Expand Down
4 changes: 2 additions & 2 deletions t/mojo/home.t
@@ -1,14 +1,14 @@
use Mojo::Base -strict;

use Test::More tests => 16;
use Test::More tests => 15;

use Cwd qw/cwd realpath/;
use File::Spec::Functions qw/canonpath catdir splitdir/;
use FindBin;
use List::Util 'first';

# "Uh, no, you got the wrong number. This is 9-1... 2"
use_ok 'Mojo::Home';
use Mojo::Home;

# ENV detection
{
Expand Down
4 changes: 2 additions & 2 deletions t/mojo/hypnotoad.t
Expand Up @@ -19,10 +19,10 @@ use Mojo::UserAgent;

plan skip_all => 'set TEST_HYPNOTOAD to enable this test (developer only!)'
unless $ENV{TEST_HYPNOTOAD};
plan tests => 51;
plan tests => 50;

# "I ate the blue ones... they taste like burning."
use_ok 'Mojo::Server::Hypnotoad';
use Mojo::Server::Hypnotoad;

# Prepare script
my $cwd = cwd;
Expand Down

0 comments on commit 47f4c83

Please sign in to comment.