fixing ch2 tests and rubocop errors