It probably doesn't work cross-platform, but it's how Beaker itself is written. I suppose the regex could have been "#{@ps} restart" since that fits with systems that restart their services with commands of the form "<command> <service> <subcommand>" but I'm not familiar enough with all possible platforms. Anyway, it seemed reasonable to me at the time to test against what Beaker is explicitly doing anyway.

It's not clear whether I should be fixing what appear to be long-standing bugs in Beaker while working on JVM Puppet