Fix Gem-based test failures and add Code Climate coverage.