The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
use strict;
use warnings;

use Test::More tests => 2;
use Data::Dumper;

use_ok 'Rex::Commands::Fs';

my $fake_file = "file_that_does_not_exist";
eval { Rex::Commands::Fs::stat($fake_file); };
my $err = $@;
like(
  $err,
  qr/^Can't stat $fake_file/,
  "Trying to stat a non-existent file throws an exception"
);