Navigation Menu

Skip to content

Commit

Permalink
fixed small test bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Oct 22, 2011
1 parent 84129a3 commit 111c858
Show file tree
Hide file tree
Showing 19 changed files with 46 additions and 48 deletions.
6 changes: 3 additions & 3 deletions t/mojo/app.t
Expand Up @@ -9,9 +9,6 @@ BEGIN {

use Test::More tests => 44;

use_ok 'Mojo';
use_ok 'Mojo::HelloWorld';

# "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.
Expand All @@ -21,6 +18,9 @@ use Mojo::IOLoop;
use Mojo::Transaction::HTTP;
use Mojo::UserAgent;

use_ok 'Mojo';
use_ok 'Mojo::HelloWorld';

# Logger
my $logger = Mojo::Log->new;
my $app = Mojo->new({log => $logger});
Expand Down
4 changes: 2 additions & 2 deletions t/mojo/cookiejar.t
Expand Up @@ -3,14 +3,14 @@ use Mojo::Base -strict;

use Test::More tests => 87;

use_ok 'Mojo::CookieJar';

# "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::URL;

use_ok 'Mojo::CookieJar';

# Session cookie
my $jar = Mojo::CookieJar->new;
$jar->add(
Expand Down
6 changes: 3 additions & 3 deletions t/mojo/dom.t
Expand Up @@ -5,13 +5,13 @@ use utf8;

use Test::More tests => 697;

use ojo;
use Mojo::Util 'encode';

# "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::Util 'encode';

# ojo
is x('<div>Hello ♥!</div>')->at('div')->text, 'Hello ♥!', 'right text';

Expand Down
7 changes: 3 additions & 4 deletions t/mojo/ioloop_tls.t
Expand Up @@ -29,18 +29,17 @@ BEGIN {
# -out badclient.crt
use Test::More;
use Mojo::IOLoop::Server;
use Mojo::IOLoop::Stream;
plan skip_all => 'set TEST_TLS to enable this test (developer only!)'
unless $ENV{TEST_TLS};
plan skip_all => 'IO::Socket::SSL 1.37 required for this test!'
unless Mojo::IOLoop::Server::TLS;
plan tests => 28;

use Mojo::IOLoop;
plan tests => 29;

# "To the panic room!
# We don't have a panic room.
# To the panic room store!"
use_ok 'Mojo::IOLoop';

my $loop = Mojo::IOLoop->new;
my $port = Mojo::IOLoop->generate_port;
my ($server, $client) = '';
Expand Down
8 changes: 4 additions & 4 deletions t/mojo/iowatcher.t
Expand Up @@ -7,15 +7,15 @@ BEGIN {
$ENV{MOJO_IOWATCHER} = 'Mojo::IOWatcher';
}

# "I don't mind being called a liar when I'm lying, or about to lie,
# or just finished lying, but NOT WHEN I'M TELLING THE TRUTH."
use Test::More tests => 50;

use_ok 'Mojo::IOWatcher';

# "I don't mind being called a liar when I'm lying, or about to lie,
# or just finished lying, but NOT WHEN I'M TELLING THE TRUTH."
use IO::Socket::INET;
use Mojo::IOLoop;

use_ok 'Mojo::IOWatcher';

# Listen
my $port = Mojo::IOLoop->generate_port;
my $listen = IO::Socket::INET->new(
Expand Down
6 changes: 3 additions & 3 deletions t/mojo/iowatcher_ev.t
Expand Up @@ -6,17 +6,17 @@ BEGIN { $ENV{MOJO_NO_BONJOUR} = $ENV{MOJO_NO_IPV6} = 1 }

use Test::More;

# "Oh well. At least we'll die doing what we love: inhaling molten rock."
plan skip_all => 'set TEST_EV to enable this test (developer only!)'
unless $ENV{TEST_EV};
plan skip_all => 'EV 4.0 required for this test!' unless eval 'use EV 4.0; 1';
plan tests => 50;

use_ok 'Mojo::IOWatcher::EV';

use IO::Socket::INET;
use Mojo::IOLoop;

# "Oh well. At least we'll die doing what we love: inhaling molten rock."
use_ok 'Mojo::IOWatcher::EV';

# Listen
my $port = Mojo::IOLoop->generate_port;
my $listen = IO::Socket::INET->new(
Expand Down
8 changes: 4 additions & 4 deletions t/mojo/morbo.t
Expand Up @@ -9,6 +9,10 @@ BEGIN {

use Test::More;

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

use Cwd 'cwd';
use File::Temp;
use FindBin;
Expand All @@ -17,10 +21,6 @@ use Mojo::Command;
use Mojo::IOLoop;
use Mojo::UserAgent;

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

# "Morbo wishes these stalwart nomads peace among the Dutch tulips.
# At least all those windmills will keep them cool.
# WINDMILLS DO NOT WORK THAT WAY! GOODNIGHT!"
Expand Down
9 changes: 4 additions & 5 deletions t/mojo/request.t
Expand Up @@ -5,18 +5,17 @@ use utf8;

use Test::More tests => 863;

use File::Spec;
use File::Temp;

use_ok 'Mojo::Message::Request';

# "When will I learn?
# The answer to life's problems aren't at the bottom of a bottle,
# they're on TV!"
use File::Spec;
use File::Temp;
use Mojo::Content::Single;
use Mojo::Content::MultiPart;
use Mojo::Cookie::Request;

use_ok 'Mojo::Message::Request';

# Parse HTTP 1.1 message with huge "Cookie" header exceeding all limits
my $req = Mojo::Message::Request->new;
$req->parse("GET / HTTP/1.1\x0d\x0a");
Expand Down
5 changes: 2 additions & 3 deletions t/mojo/resolver.t
Expand Up @@ -9,15 +9,14 @@ BEGIN {

use Test::More tests => 29;

use_ok 'Mojo::IOLoop::Resolver';

# "Oh, I'm in no condition to drive. Wait a minute.
# I don't have to listen to myself. I'm drunk."
use Mojo::IOLoop;

my $r = Mojo::IOLoop->singleton->resolver;
use_ok 'Mojo::IOLoop::Resolver';

# Check IPv4 and IPv6 addresses
my $r = Mojo::IOLoop->singleton->resolver;
is $r->is_ipv4('mojolicio.us'), undef, 'not an IPv4 address';
is $r->is_ipv6('mojolicio.us'), undef, 'not an IPv6 address';
is $r->is_ipv4('[::1]'), undef, 'not an IPv4 address';
Expand Down
9 changes: 4 additions & 5 deletions t/mojo/resolver_online.t
Expand Up @@ -13,16 +13,15 @@ plan skip_all => 'set TEST_ONLINE to enable this test (developer only!)'
plan skip_all => 'Perl 5.12 required for this test!' unless $] >= 5.012;
plan tests => 20;

use_ok 'Mojo::IOLoop';

use List::Util 'first';

# "Your guilty consciences may make you vote Democratic, but secretly you all
# yearn for a Republican president to lower taxes, brutalize criminals, and
# rule you like a king!"
my $r = Mojo::IOLoop->singleton->resolver;
use List::Util 'first';

use_ok 'Mojo::IOLoop';

# Resolve all record
my $r = Mojo::IOLoop->singleton->resolver;
my %types;
$r->resolve(
'www.google.com',
Expand Down
4 changes: 2 additions & 2 deletions t/mojo/response.t
Expand Up @@ -3,8 +3,6 @@ use Mojo::Base -strict;

use Test::More tests => 270;

use_ok 'Mojo::Message::Response';

# "Quick Smithers. Bring the mind eraser device!
# You mean the revolver, sir?
# Precisely."
Expand All @@ -14,6 +12,8 @@ use Mojo::Content::MultiPart;
use Mojo::Cookie::Response;
use Mojo::Headers;

use_ok 'Mojo::Message::Response';

# Status code and message
my $res = Mojo::Message::Response->new;
is $res->code, undef, 'no status';
Expand Down
4 changes: 2 additions & 2 deletions t/mojo/user_agent.t
Expand Up @@ -9,12 +9,12 @@ BEGIN {

use Test::More tests => 68;

use_ok 'Mojo::UserAgent';

# "The strong must protect the sweet."
use Mojo::IOLoop;
use Mojolicious::Lite;

use_ok 'Mojo::UserAgent';

# Silence
app->log->level('fatal');

Expand Down
4 changes: 2 additions & 2 deletions t/mojo/user_agent_online.t
Expand Up @@ -13,14 +13,14 @@ plan skip_all => 'set TEST_ONLINE to enable this test (developer only!)'
unless $ENV{TEST_ONLINE};
plan tests => 101;

use_ok 'Mojo::UserAgent';

# "So then I said to the cop, "No, you're driving under the influence...
# of being a jerk"."
use Mojo::IOLoop;
use Mojo::Transaction::HTTP;
use ojo;

use_ok 'Mojo::UserAgent';

# Make sure user agents dont taint the ioloop
my $loop = Mojo::IOLoop->singleton;
my $ua = Mojo::UserAgent->new;
Expand Down
1 change: 0 additions & 1 deletion t/mojo/websocket_proxy_tls.t
Expand Up @@ -10,7 +10,6 @@ BEGIN {
# "Hey, Weener Boy... where do you think you're going?"
use Test::More;
use Mojo::IOLoop::Server;
use Mojo::IOLoop::Stream;
plan skip_all => 'set TEST_TLS to enable this test (developer only!)'
unless $ENV{TEST_TLS};
plan skip_all => 'IO::Socket::SSL 1.37 required for this test!'
Expand Down
2 changes: 1 addition & 1 deletion t/mojolicious/app.t
Expand Up @@ -16,8 +16,8 @@ use lib "$FindBin::Bin/lib";
use File::Spec;
use Mojo::Date;
use Mojo::Transaction::HTTP;
use Test::Mojo;
use Mojolicious;
use Test::Mojo;

# "Congratulations Fry, you've snagged the perfect girlfriend.
# Amy's rich, she's probably got other characteristics..."
Expand Down
4 changes: 3 additions & 1 deletion t/mojolicious/external_app.t
Expand Up @@ -13,10 +13,12 @@ BEGIN {
# "Of all the parasites I've had over the years,
# these worms are among the best."
use Test::More tests => 9;
use Test::Mojo;

use FindBin;
use lib "$FindBin::Bin/external/lib";

use Test::Mojo;

my $t = Test::Mojo->new('MyApp');

# GET /
Expand Down
1 change: 1 addition & 0 deletions t/mojolicious/external_lite_app.t
Expand Up @@ -15,6 +15,7 @@ use Test::More tests => 15;

use FindBin;
require "$FindBin::Bin/external/myapp.pl";

use Test::Mojo;

my $t = Test::Mojo->new;
Expand Down
5 changes: 3 additions & 2 deletions t/mojolicious/layouted_lite_app.t
Expand Up @@ -9,14 +9,15 @@ BEGIN {

use Test::More tests => 82;

use FindBin;
use lib "$FindBin::Bin/lib";

# "We're certainly not building anything sinster, if that's what you mean.
# Now come on, something sinister won't build itself."
use Mojolicious::Lite;
use Test::Mojo;

# Plugin with a template
use FindBin;
use lib "$FindBin::Bin/lib";
plugin 'PluginWithTemplate';

app->renderer->root(app->home->rel_dir('does_not_exist'));
Expand Down
1 change: 0 additions & 1 deletion t/mojolicious/tls_lite_app.t
Expand Up @@ -9,7 +9,6 @@ BEGIN {

use Test::More;
use Mojo::IOLoop::Server;
use Mojo::IOLoop::Stream;
plan skip_all => 'set TEST_TLS to enable this test (developer only!)'
unless $ENV{TEST_TLS};
plan skip_all => 'IO::Socket::SSL 1.37 required for this test!'
Expand Down

0 comments on commit 111c858

Please sign in to comment.