Fix for #1451

Line codec was using an undefined variable which caused it to throw an exception.

Fixed and added tests for line codecs

Closes #1451
expect(subject).to receive(:on_event).once.and_call_original