<commit_before>#!/usr/bin/env perl
use strict;
use warnings;
use FindBin;
use lib $FindBin::Bin;

use File::Spec::Functions qw( catdir );
use Test::Spec;
use Test::Output;
use Test::Exception;
use App::perlbrew;

require "test_helpers.pl";
mock_perlbrew_install("perl-5.14.1");
mock_perlbrew_install("perl-5.14.2");
mock_perlbrew_install("perl-5.14.3");

describe "lib command," => sub {
    it "shows a page of usage synopsis when no sub-command are given." => sub {
        stdout_like {
            App::perlbrew->new("lib")->run;

        } qr/usage/i;
    };

    describe "without lib name" => sub {
        it "create errs gracefully showing usage" => sub {
            my $app = App::perlbrew->new;
            throws_ok {
                $app->{args} = [ "lib", "create"];
                $app->run;
            } qr/ERROR: /i;<commit_msg>fixed test-fail<commit_after>#!/usr/bin/env perl
use strict;
use warnings;
use FindBin;
use lib $FindBin::Bin;

use File::Spec::Functions qw( catdir );
use Test::Spec;
use Test::Output;
use Test::Exception;
use App::perlbrew;

require "test_helpers.pl";
mock_perlbrew_install("perl-5.14.1");
mock_perlbrew_install("perl-5.14.2");
mock_perlbrew_install("perl-5.14.3");

describe "lib command," => sub {
    describe "when invoked with unknown action name,", sub {
        it "should display error" => sub {
            my $x   = "correcthorsebatterystaple";
            my $app = App::perlbrew->new("lib", $x);
            stdout_like {
                eval {
                    $app->run;
                    1;
                }
                or do {
                    print STDERR $@;
                };
            } qr/Unknown command: $x/;
        }
    };

    describe "without lib name" => sub {
        it "create errs gracefully showing usage" => sub {
            my $app = App::perlbrew->new;
            throws_ok {
                $app->{args} = [ "lib", "create"];
                $app->run;
            } qr/ERROR: /i;
{'fraction_non_alphanumeric': 0.14846502264720685, 'fraction_numerical': 0.012581781580271767, 'mean_word_length': 2.067901234567901, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6047483', 'n_tokens_mistral': 674, 'n_tokens_neox': 627, 'n_words': 155}