Skip to content

Commit

Permalink
Merge pull request ledgersmb#59 from ledgersmb/1.3
Browse files Browse the repository at this point in the history
1.3
  • Loading branch information
einhverfr committed Sep 6, 2014
2 parents ab76ca5 + 3396241 commit bc1ce41
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 18 deletions.
45 changes: 45 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
language: perl
perl:
- '5.10'
- '5.12'
- '5.14'
- '5.16'
- '5.18'
- '5.20'
addons:
postgresql: "9.3"
env:
- DB_TESTING: 1
before_install:
- "cpanm DBI"
- "cpanm DBD::Pg"
- "cpanm Try::Tiny"
- "cpanm Memoize"
- "cpanm Test::More"
- "cpanm Test::Trap"
- "cpanm Test::Exception"
- "cpanm Devel::Cover::Report::Coveralls"
- "cpanm Data::Dumper"
- "cpanm Log::Log4perl"
- "cpanm Locale::Maketext"
- "cpanm DateTime"
- "cpanm Locale::Maketext::Lexicon"
- "cpanm MIME::Base64"
- "cpanm Digest::MD5"
- "cpanm HTML::Entities"
- "cpanm Math::BigFloat"
- "cpanm IO::File"
- "cpanm IO::Scalar"
- "cpanm Encode"
- "cpanm Time::Local"
- "cpanm Cwd"
- "cpanm --force Class::Std"
- "cpanm Config::Std"
- "cpanm Mojo::Base"
- "cpanm MIME::Lite"
- "cpanm Template"
- "cpanm Error"
- "cpanm CGI::Simple"
- "cpanm File::MimeInfo"
script:
export RELEASE_TESTING=1 && yes n | perl Makefile.PL && PGUSER=postgres PGPASSWORD=test LSMB_TEST_DB=1 LSMB_NEW_DB=lsmb13installtest make test && cover -test -report coveralls
27 changes: 12 additions & 15 deletions t/04-template-handling.t
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ use LedgerSMB::Template;
use LedgerSMB::Template::Elements;
use LedgerSMB::Template::CSV;
use LedgerSMB::Template::HTML;
my $has_latex = 0;
( eval {require LedgerSMB::Template::LaTeX }
&& eval {require Template::Latex}
&& eval {require Template::Plugins::Latex}
) || ($has_latex = 1) ;
use LedgerSMB::Template::TXT;

$LedgerSMB::Sysconfig::tempdir = 't/var';
Expand Down Expand Up @@ -336,7 +331,7 @@ throws_ok{$template->render({'login' => 'foo'})} qr/Can't locate/,
#####################

SKIP: {
skip "LaTeX modules not installed" unless $has_latex;
skip "LATEX_TESTING not set", 7 unless $ENV{LATEX_TESTING};
$template = undef;
$template = new LedgerSMB::Template('user' => $myconfig, 'format' => 'PDF',
'template' => '04-template', 'no_auto_output' => 1);
Expand Down Expand Up @@ -581,20 +576,22 @@ is(grep(/Locked by/, @output), 1, 'Invoice locked label shown');


# LPR PRinting Tests
use LedgerSMB::Sysconfig;
%LedgerSMB::Sysconfig::printer = ('test' => 'cat > t/var/04-lpr-test');
SKIP: {
skip 'LATEX_TESTING is not set', 2 unless $ENV{LATEX_TESTING};
use LedgerSMB::Sysconfig;
%LedgerSMB::Sysconfig::printer = ('test' => 'cat > t/var/04-lpr-test');

$template = new LedgerSMB::Template('user' => $myconfig, 'format' => 'PDF',
$template = new LedgerSMB::Template('user' => $myconfig, 'format' => 'PDF',
'template' => '04-template', 'locale' => $locale, no_auto_output => 1);
$template->render({media => 'test'});
$template->output(media => 'test');
$template->render({media => 'test'});
$template->output(media => 'test');

ok (open (LPR_TEST, '<', 't/var/04-lpr-test'), 'LedgerSMB::Template::_output_lpr output file opened successfully');
ok (open (LPR_TEST, '<', 't/var/04-lpr-test'), 'LedgerSMB::Template::_output_lpr output file opened successfully');

my $line1 = <LPR_TEST>;

like($line1, qr/^%PDF/, 'output file is pdf');
my $line1 = <LPR_TEST>;

like($line1, qr/^%PDF/, 'output file is pdf');
}
$template = LedgerSMB::Template->new(
path => 'UI',
template => 'rp-payments',
Expand Down
4 changes: 1 addition & 3 deletions t/98-pod-coverage.t
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ eval "use Test::Pod::Coverage";
if ($@){
plan skip_all => "Test::Pod::Coverage required for testing POD coverage";
} else {
plan tests => 30;
plan tests => 28;
}
pod_coverage_ok("LedgerSMB");
pod_coverage_ok("LedgerSMB::Form");
Expand All @@ -25,8 +25,6 @@ pod_coverage_ok("LedgerSMB::Mailer");
pod_coverage_ok("LedgerSMB::Template");
pod_coverage_ok("LedgerSMB::Template::CSV");
pod_coverage_ok("LedgerSMB::Template::HTML");
pod_coverage_ok("LedgerSMB::Template::LaTeX");
pod_coverage_ok("LedgerSMB::Template::ODS");
pod_coverage_ok("LedgerSMB::Template::TXT");
pod_coverage_ok("LedgerSMB::User");
pod_coverage_ok("LedgerSMB::DBObject::Date");
Expand Down

0 comments on commit bc1ce41

Please sign in to comment.