• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gugod / App-perlbrew / 5101900754

pending completion
5101900754

Pull #776

github

web-flow
Merge 4fe3b6fef into 04173359a
Pull Request #776: New command: make shim

69 of 69 new or added lines in 3 files covered. (100.0%)

3116 of 3939 relevant lines covered (79.11%)

80.05 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.89
/t/command-make-shim.t
1
#!/usr/bin/env perl
2
use strict;
1✔
3
use warnings;
1✔
4
use Test::Spec;
1✔
5
use Test::Exception;
1✔
6
use File::Temp qw( tempdir );
1✔
7

8

9
use FindBin;
1✔
10
use lib $FindBin::Bin;
1✔
11

12
use App::perlbrew;
1✔
13
require "test_helpers.pl";
×
14

15
mock_perlbrew_install("perl-5.36.1");
×
16

17

18
describe "App::perlbrew->make_shim('foo')" => sub {
19
    it "should err when perlbrew is off" => sub {
20
        mock_perlbrew_off();
1✔
21

22
        my $dir = tempdir();
1✔
23
        chdir($dir);
1✔
24

25
        throws_ok {
26
            my $app = App::perlbrew->new("make-shim", "foo");
1✔
27
            $app->run();
1✔
28
        } qr(^ERROR:);
1✔
29

30
        ok ! -f "foo", "foo is not produced";
1✔
31
    };
1✔
32

33
    it "should err when 'foo' already exists" => sub {
34
        mock_perlbrew_use("perl-5.36.1");
1✔
35
        my $dir = tempdir();
1✔
36
        chdir($dir);
1✔
37
        io("foo")->print("hello");
1✔
38

39
        throws_ok {
40
            my $app = App::perlbrew->new("make-shim", "foo");
1✔
41
            $app->run();
1✔
42
        } qr(^ERROR:);
1✔
43
    };
1✔
44

45
    it "should produce 'foo' in the current dir" => sub {
46
        mock_perlbrew_use("perl-5.36.1");
1✔
47
        my $dir = tempdir();
1✔
48
        chdir($dir);
1✔
49

50
        my $app = App::perlbrew->new("make-shim", "foo");
1✔
51
        $app->run();
1✔
52

53
        ok -f "foo", "foo is produced under current directory.";
1✔
54
        my $shim_content = io("foo")->slurp;
1✔
55
        diag "\nThe content of shim:\n----\n$shim_content\n----\n";
1✔
56
    };
1✔
57
};
×
58

59
runtests unless caller;
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc