Alien-InteractiveBrokers
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
t/10-Alien-InteractiveBrokers.t view on Meta::CPAN
#!perl -T
#
# Alien::InteractiveBrokers - tests for main module
#
# Copyright (c) 2010-2012 Jason McManus
#
use Data::Dumper;
use File::Spec::Functions qw( catdir catfile );
use Test::More tests => 12;
use strict;
use warnings;
###
### Vars
###
use vars qw( $TRUE $FALSE $VERSION );
BEGIN {
$VERSION = '9.6602';
}
*TRUE = \1;
*FALSE = \0;
my $obj;
###
### Tests
###
# Uncomment for use tests
BEGIN {
use_ok( 'Alien::InteractiveBrokers' ) || print "Bail out!";
}
################################################################
# Test: Can instantiate object
# Expected: PASS
isa_ok( $obj = Alien::InteractiveBrokers->new(), 'Alien::InteractiveBrokers' );
# Test object cache is empty
is_deeply( $obj, {}, 'AIB cache: empty' );
################################################################
# Test: all methods
# Expected: PASS
# Set up some junk
my $aib_path = $INC{ join( '/', 'Alien', 'InteractiveBrokers.pm' ) };
$aib_path =~ s{\.pm$}{};
my $aib_base = catdir( $aib_path, 'IBJts' );
# Check correct version looked up
my $version = get_api_version( $aib_base );
cmp_ok( length( $obj->version() ), '>', 0, 'version()' );
diag( "API Version " . $obj->version() );
# Check correct path
is( $obj->path(), $aib_base, 'path()' );
# Check correct classpath
my $classpath = catfile( $aib_base, 'jtsclient.jar' );
is( $obj->classpath(), $classpath, 'classpath()' );
# Check correct includes
my @includes = (
'-I' . catdir( $aib_base, 'cpp', 'Shared' ),
view all matches for this distributionview release on metacpan - search on metacpan
( run in 0.515 second using v1.00-cache-2.02-grep-82fe00e-cpan-2c419f77a38b )