diff --git a/t/rc_options.t b/t/rc_options.t index bf88c68..5f0fe87 100755 --- a/t/rc_options.t +++ b/t/rc_options.t @@ -7,7 +7,7 @@ use strict; use warnings; -use Test::More tests => 2; +use Test::More tests => 4; use testutil; @@ -46,6 +46,32 @@ is($options->{target}, "$OUT_DIR/target", "rc options different lines"); is($options->{dir}, "$OUT_DIR/stow", "rc options different lines"); # +# Test that scalar cli option overwrites conflicting stowrc option. +# +local @ARGV = ('-d', "$OUT_DIR/stow",'dummy'); +$rc_contents = <{dir}, "$OUT_DIR/stow", "cli overwrite scalar rc option."); + +# +# Test that list cli option merges with conflicting stowrc option. +# Documentation states that stowrc options are prepended to cli options. +# +local @ARGV = ( + '--defer=man', + 'dummy' +); +$rc_contents = <{defer}, [qr(\Ainfo), qr(\Aman)], + 'defer man and info'); + # Clean up files used for testing. # unlink $RC_FILE or die "Unable to clean up $RC_FILE.\n";