diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2017-08-23 17:23:28 +0200 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2017-08-23 17:23:28 +0200 |
commit | 961da7d0a7024628ec87c02c158a147dd64b3317 (patch) | |
tree | 534ab18dc3f85e1c74040102b47c93785f3e3697 | |
parent | bc97931e2def4efee8418ce62ebc4818a31cf163 (diff) | |
download | gitlab-ce-961da7d0a7024628ec87c02c158a147dd64b3317.tar.gz |
Add tests for Committer#==
-rw-r--r-- | spec/lib/gitlab/git/committer_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/lib/gitlab/git/committer_spec.rb b/spec/lib/gitlab/git/committer_spec.rb new file mode 100644 index 00000000000..b0ddbb51449 --- /dev/null +++ b/spec/lib/gitlab/git/committer_spec.rb @@ -0,0 +1,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 |