gitlab-org--gitlab-foss/spec/lib/gitlab/git/user_spec.rb
2017-09-14 17:42:02 +02:00

22 lines
657 B
Ruby

require 'spec_helper'
describe Gitlab::Git::User 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