add new common function spec_from_line with tests