require"spec_helper"describeGitlab::ChangesListdolet(:valid_changes_string){"\n000000 570e7b2 refs/heads/my_branch\nd14d6c 6fd24d refs/heads/master"}let(:invalid_changes){1}context'when changes is a valid string'dolet(:changes_list){Gitlab::ChangesList.new(valid_changes_string)}it'splits elements by newline character'doexpect(changes_list).tocontain_exactly({oldrev: "000000",newrev: "570e7b2",ref: "refs/heads/my_branch"},{oldrev: "d14d6c",newrev: "6fd24d",ref: "refs/heads/master"})endit'behaves like a list'doexpect(changes_list.first).toeq({oldrev: "000000",newrev: "570e7b2",ref: "refs/heads/my_branch"})endendend