6 use lib "$FindBin::Bin/lib";
7 use aliased 'System::Introspector::Report::Publish::MediaWiki';
9 $ENV{TEST_SI_REPORT_OUT} = my $out_dir = File::Temp->newdir;
10 $ENV{TEST_SI_REPORT_IN} = "$FindBin::Bin/data";
14 my $wiki = MediaWiki->new(
15 api_uri => 'http://example.com:9999/',
16 connection_class => 'TestConnection',
27 { id => [qw( foo a )],
31 { key => 'bar', label => 'Bar' },
32 { key => 'baz', label => 'Baz' },
35 { bar => 231, baz => 421 },
36 { bar => 232, baz => 884 },
37 { bar => 332, baz => 784 },
40 { id => [qw( foo b )],
44 { key => 'bar', label => 'Bar' },
45 { key => 'baz', label => 'Baz' },
48 { bar => 231, baz => 421 },
49 { bar => 332, baz => 784 },
52 { id => [qw( foo c )],
56 { key => 'bar', label => 'New Bar' },
57 { key => 'baz', label => 'New Baz' },
60 { bar => 232, baz => 884 },
61 { bar => 332, baz => 784 },
62 { bar => 989, baz => "foo\nbar" },
69 $string =~ s{[\s\n]+}{}g;
73 ## uncomment to regenerate result file
74 # do { no warnings; io("$out_dir/foo") > io("$FindBin::Bin/data/result/foo.txt"); fail "regenerated" };
76 is scalar(io("$out_dir/foo")->slurp)->$_despace,
77 scalar(io("$FindBin::Bin/data/result/foo.txt")->slurp)->$_despace,
78 'resulting page looks correct';