summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/git/committer_spec.rb
blob: b0ddbb5144917e8d3807496968c8c020f60843f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require 'spec_helper'

describe Gitlab::Git::Committer do
  let(:name) { 'Jane Doe' }
  let(:email) { 'janedoe@example.com' }
  let(:gl_id) { 'user-123' }

  subject { described_class.new(name, email, gl_id) }

  describe '#==' do
    def eq_other(name, email, gl_id)
      eq(described_class.new(name, email, gl_id))
    end

    it { expect(subject).to eq_other(name, email, gl_id) }

    it { expect(subject).not_to eq_other(nil, nil, nil) }
    it { expect(subject).not_to eq_other(name + 'x', email, gl_id) }
    it { expect(subject).not_to eq_other(name, email + 'x', gl_id) }
    it { expect(subject).not_to eq_other(name, email, gl_id + 'x') }
  end
end