Permalink
Browse files

added tests for S::L::Custom

  • Loading branch information...
1 parent 06bfbe5 commit ccb121f38e495cb56230a28b02f7393767a4ce2a @polettix polettix committed with rjbs Oct 23, 2010
Showing with 63 additions and 0 deletions.
  1. +20 −0 t/custom-license
  2. +43 −0 t/custom.t
View
20 t/custom-license
@@ -0,0 +1,20 @@
+__[ NAME ]__
+The Foo-Bar License
+__URL__
+http://www.example.com/foo-bar.txt
+__[ META_NAME ]__
+foo_bar_meta
+__{ META2_NAME }__
+foo_bar_meta2
+__[ NOTICE ]__
+Copyright (C) {{$self->year}} by {{$self->holder}}.
+
+This is free software, licensed under {{$self->name}}.
+
+__[ LICENSE ]__
+ The Foo-Bar License
+
+Well... this is only some sample text. I'm true... only sample text!!!
+
+Yes, spanning more lines and more paragraphs.
+
View
43 t/custom.t
@@ -0,0 +1,43 @@
+# vim: filetype=perl :
+use strict;
+use warnings;
+
+#use Test::More tests => 1; # last test to print
+use Test::More 'no_plan'; # substitute with previous line when done
+
+use Software::License::Custom;
+
+my $slc = Software::License::Custom->new({
+ holder => 'A. U. Thor',
+ year => 1972,
+ filename => 't/custom-license'
+});
+isa_ok($slc, 'Software::License');
+
+is($slc->name(), 'The Foo-Bar License', 'name()');
+is($slc->url(), 'http://www.example.com/foo-bar.txt', 'url()');
+is($slc->meta_name(), 'foo_bar_meta', 'meta_name()');
+is($slc->meta2_name(), 'foo_bar_meta2', 'meta2_name()');
+is($slc->notice(), <<'END_OF_NOTICE', 'notice()');
+Copyright (C) 1972 by A. U. Thor.
+
+This is free software, licensed under The Foo-Bar License.
+END_OF_NOTICE
+is($slc->license(), <<'END_OF_LICENSE', 'license()');
+ The Foo-Bar License
+
+Well... this is only some sample text. I'm true... only sample text!!!
+
+Yes, spanning more lines and more paragraphs.
+END_OF_LICENSE
+is($slc->fulltext(), <<'END_OF_FULLTEXT', 'fulltext()');
+Copyright (C) 1972 by A. U. Thor.
+
+This is free software, licensed under The Foo-Bar License.
+
+ The Foo-Bar License
+
+Well... this is only some sample text. I'm true... only sample text!!!
+
+Yes, spanning more lines and more paragraphs.
+END_OF_FULLTEXT

0 comments on commit ccb121f

Please sign in to comment.