Almost-minimal filesystem based blog.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
790 B

17 years ago
17 years ago
17 years ago
8 years ago
8 years ago
6 years ago
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4. use lib 'lib';
  5. use Test::More tests => 4;
  6. use App::WRT;
  7. chdir 'example';
  8. # 'configuration';
  9. ok(
  10. my $w = App::WRT::new_from_file('wrt.json'),
  11. "Got WRT object."
  12. );
  13. # 'individual subroutine tests';
  14. ok(
  15. $w->recent_month() =~ m/\d{4}\/\d{1,2}/,
  16. 'recent_month returns a month'
  17. );
  18. my $datestamp = $w->datestamp('2014/1/1/test_entry');
  19. # diag($datestamp);
  20. ok(
  21. $datestamp =~ m{test_entry},
  22. 'datestamp for a fragment references that fragment'
  23. );
  24. # icon rendering
  25. my $with_icon = $w->display('icon_test');
  26. # diag($with_icon);
  27. ok(
  28. $with_icon =~ m/img src/,
  29. 'icon_test has an image in it'
  30. );
  31. # rendering static html files
  32. # ok(
  33. # $w->render(sub { diag($_[0]); }),
  34. # 'render stuff'
  35. # );