Implements some rubocop suggestions.

Adds test assertions.