|
do 'utility_funcs.pl' ;
my $tests = 3;
plan tests => $tests ;
my $obj ;
$obj = JSON::Karabiner->new( 'some_title' , 'file.json' , { mod_file_dir => "$ENV{HOME}/" });
my $rule = $obj ->add_rule( 'some rule' );
my $manip = $rule ->add_manipulator;
my $to = $manip ->add_action( 'to' );
dies_ok { $obj ->_fake_write_file} 'catches manipulator with key' ;
throws_ok { $obj ->_fake_write_file} qr/no 'from'/ i, 'throws correct error' ;
my $from = $manip ->add_action( 'from' );
throws_ok { $obj ->_fake_write_file} qr/'from'.*is empty/ i, 'throws correct error' ;
$obj ->_dump_json;
|