add spec and write 4 tests for each global function