All you get from the command line is ARGS. You can organize the whole logic of parsing that into a function
function parse_args(args)
...
end
and test it with
parse_args(["-w", "word1 word2 word3", "-e", "20"])
then just use it as parse_args(ARGS).