Ruby and JS tests for distinct