Improve dash n spec

This adds specs for the expected behaviour of BEGIN/END when using the -n command-line option.