Remove duplicated code

They both do the same thing!
Merge pull request #24 from joneslee85/patch-2

Remove duplicated code in tests