Fix a test spec bug and implement the current test spec.