use pry in tests only if env var is passed to fix the CI ruby 1.8 compatability
fix rubocop codestyle warnings