Skip to content

Commit

Permalink
restore the Xena factoids ; added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shlomif committed Aug 27, 2020
1 parent 28b34e4 commit 831bdce
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 3 deletions.
14 changes: 13 additions & 1 deletion Tests/content-fortunes-text.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use strict;
use warnings;
use Test::More tests => 7;
use Test::More tests => 9;
use Path::Tiny qw/ path /;
use lib './lib';
use HTML::Latemp::Local::Paths::Test ();
Expand All @@ -20,6 +20,18 @@ my $POST_DEST = $obj->t2_post_dest();
'Plain text fortune exists and contains text.',
);

$content = path("$POST_DEST/humour/fortunes/shlomif-factoids")->slurp_utf8;

# TEST
like( $content, qr{Xena can meet King David}ms, 'Search for "Xena"', );
#
# TEST
like(
$content,
qr{Xena the Warrior Princess has not met Chuck}ms,
'Search for "Xena"',
);

# TEST
ok( scalar( -e "$POST_DEST/humour/fortunes/tinic.dat" ),
".dat file exists." );
Expand Down
4 changes: 3 additions & 1 deletion lib/factoids/merge_into_fortunes.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
FULL_NAMES = {"chuck": "Chuck Norris",
"emma-watson": "Emma Watson",
"nsa": "NSA",
"taylor-swift": "Taylor Swift", }
"taylor-swift": "Taylor Swift",
"xena": "Xena the Warrior Princess",
}

ID_IS_FACTOID_RE = re.compile("^[a-z\\-]+-fact-([a-z\\-]+)-([0-9]+)$")
BASENAME_EXTRACT_RE = re.compile('^([a-z_\\-]*)_facts$')
Expand Down
2 changes: 1 addition & 1 deletion lib/factoids/shlomif-factoids-lists.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4224,7 +4224,7 @@
</lang>
</fact>

<fact>
<fact xml:id="xena_facts--startaddmore">
<lang xml:lang="en-US">
<body>
<p>
Expand Down
10 changes: 10 additions & 0 deletions src/humour/fortunes/fortunes-shlomif-ids-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2237,6 +2237,16 @@ files:
date: 2017-10-21T13:55:19Z
shlomif-fact-win-update-9:
date: 2019-08-10T13:15:22Z
shlomif-fact-xena-1:
date: 2020-08-27T20:50:02Z
shlomif-fact-xena-2:
date: 2020-08-27T20:50:02Z
shlomif-fact-xena-3:
date: 2020-08-27T20:50:02Z
shlomif-fact-xena-4:
date: 2020-08-27T20:50:02Z
shlomif-fact-xena-5:
date: 2020-08-27T20:50:02Z
shlomif-fact-xslt-1:
date: 2010-02-02T20:37:04Z
shlomif-fact-xslt-10:
Expand Down
17 changes: 17 additions & 0 deletions src/humour/fortunes/proto--shlomif-factoids.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4431,6 +4431,23 @@ or misinformed, so people will think he's not as awesome as he really is.
</info>
</quote>
</fortune>
<fortune id="shlomif-fact-xena-1">
<meta>
<title>Shlomi Fish’s Xena the Warrior Princess Fact #1</title>
</meta>
<quote>
<body>
<p>
Xena can meet King David for breakfast and Julius
Caesar for lunch. Without time travel.
</p>
</body>
<info>
<author>Shlomi Fish</author>
<work href="http://www.shlomifish.org/humour/bits/facts/Xena/">Xena Facts by Shlomi Fish and Friends</work>
</info>
</quote>
</fortune>
<fortune id="shlomif-fact-xslt-1">
<meta>
<title>Shlomi Fish’s "How XSLT is Evil" Fact #1</title>
Expand Down

0 comments on commit 831bdce

Please sign in to comment.