File Coverage

File:t/plugin-spreadsheet.t
Coverage:100.0%

linestmtbrancondsubpodtimecode
1#!/usr/bin/env perl
2
1
1
1941
3
use v5.24;
3
4
1
1
1
164
69125
3
use Test2::V0;
5
6
1
1
1
1
1
1
1
1461
11120
5
499
2
1
12
use ok('Yukki::Web::Context');
7
1
1
1
1
1
1
1
300
2
4
522
2
2
11
use ok('Yukki::Web::Plugin::Spreadsheet');
8
9
1
88749
my $mock_app = mock 'Yukki::Web' => (
10    add_constructor => [new => 'hash'],
11);
12
13
1
187
my $mock_file = mock 'Yukki::Model::File' => (
14    add_constructor => [new => 'hash'],
15    add => [
16        fetch_formatted => '{=:1+1}',
17        repository_name => 'main',
18        full_path       => 'test.yukki',
19    ],
20);
21
22
1
269
my $app  = Yukki::Web->new;
23
1
9
my $file = Yukki::Model::File->new;
24
1
5
my $ctx  = Yukki::Web::Context->new( env => {} );
25
1
32
my $ss   = Yukki::Web::Plugin::Spreadsheet->new( app => $app );
26
27
1
34
my $output = $ss->spreadsheet_eval({
28    context => $ctx,
29    file    => $file,
30    arg     => '1+1',
31});
32
33
1
6
is $output, qq[<span title="1+1" class="spreadsheet-cell">2</span>],
34    '1+1=2';
35
36
1
485
done_testing;