Added tests
Followed rubocop's advice