Skip to content

Commit

Permalink
Added original dist tests
Browse files Browse the repository at this point in the history
  • Loading branch information
omega committed Oct 31, 2008
1 parent 1983e83 commit 1b8c1dd
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 0 deletions.
20 changes: 20 additions & 0 deletions t/orig/01-compile.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!perl

use strict;
use warnings;

use lib 'lib';

use Test::More;

plan tests => 8;

use_ok('Amazon::SimpleDB::Domain');
use_ok('Amazon::SimpleDB::ErrorResponse');
use_ok('Amazon::SimpleDB::GetAttributesResponse');
use_ok('Amazon::SimpleDB::Item');
use_ok('Amazon::SimpleDB::ListDomainsResponse');
use_ok('Amazon::SimpleDB::QueryResponse');
use_ok('Amazon::SimpleDB::Response');
use_ok('Amazon::SimpleDB');

48 changes: 48 additions & 0 deletions t/orig/10-domain.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/perl -w
use warnings;
use strict;

use lib 'lib';

use Test::More;

unless ($ENV{'AMAZON_S3_EXPENSIVE_TESTS'}) {
plan skip_all => 'Testing this module for real costs money.';
} else {
plan tests => 8;
}

my $aws_access_key_id = $ENV{'AWS_ACCESS_KEY_ID'};
my $aws_secret_access_key = $ENV{'AWS_ACCESS_KEY_SECRET'};

use Amazon::SimpleDB;

my $sdb =
Amazon::SimpleDB->new(
{
aws_access_key_id => $aws_access_key_id,
aws_secret_access_key => $aws_secret_access_key
}
);

ok($sdb);
ok($sdb->isa('Amazon::SimpleDB'));

my $domainname = 'amazon-simpledb-test-' . lc $aws_access_key_id;

ok($sdb->create_domain($domainname));

my $r_domains = $sdb->domains;
ok($r_domains->is_success);

my ($test1) = grep { $_->name eq $domainname } $r_domains->results;
ok($test1);

my $r_delete_domain = $sdb->delete_domain($domainname);
ok($r_delete_domain->is_success);

my $r_domains2 = $sdb->domains;
ok($r_domains2->is_success);

my ($test2) = grep { $_->name eq $domainname } $r_domains2->results;
ok(!$test2); # gone?
6 changes: 6 additions & 0 deletions t/orig/98-pod.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!perl -T

use Test::More;
eval "use Test::Pod 1.14";
plan skip_all => "Test::Pod 1.14 required for testing POD: $@" if $@;
all_pod_files_ok();
12 changes: 12 additions & 0 deletions t/orig/99-pod-coverage.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use Test::More;
eval "use Test::Pod::Coverage 1.00";
plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD coverage" if $@;
all_pod_coverage_ok( );

# Workaround for dumb bug (fixed in 5.8.7) where Test::Builder thinks that
# certain "die"s that happen inside evals are not actually inside evals,
# because caller() is broken if you turn on $^P like Module::Refresh does
#
# (I mean, if we've gotten to this line, then clearly the test didn't die, no?)
Test::Builder->new->{Test_Died} = 0;

0 comments on commit 1b8c1dd

Please sign in to comment.