Fix tests

Fix rubocop and foodcritic problems
More information in commits

Based on #1