Copying the tests from gist