diff options
author | Quang-Minh Nguyen <qmnguyen@gitlab.com> | 2022-10-31 19:58:10 +0300 |
---|---|---|
committer | Quang-Minh Nguyen <qmnguyen@gitlab.com> | 2022-10-31 20:21:08 +0300 |
commit | a238cbfb8fd039b2fed350aa81f0c0154d9a01f5 (patch) | |
tree | 776847ab602d962e43568059ba2b41e166711ba5 /ruby/spec/lib/gitlab/git/user_spec.rb | |
parent | 4440aae1c028c263b37ee6f149f11179d22147f8 (diff) |
ruby: Remove ruby/lib/gitlab/git/*
Those classes wrap around rugged data and provide some advanced
sugar-coating methods. Both FindLicense and gitaly-linguist use the
underlying gems exclusively. Those wrappers become obsolete now.
Changelog: other
Diffstat (limited to 'ruby/spec/lib/gitlab/git/user_spec.rb')
-rw-r--r-- | ruby/spec/lib/gitlab/git/user_spec.rb | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/ruby/spec/lib/gitlab/git/user_spec.rb b/ruby/spec/lib/gitlab/git/user_spec.rb deleted file mode 100644 index 778fc3c80..000000000 --- a/ruby/spec/lib/gitlab/git/user_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -require 'spec_helper' - -describe Gitlab::Git::User do - let(:username) { 'janedoe' } - let(:name) { 'Jane Doé' } - let(:email) { 'janedoé@example.com' } - let(:gl_id) { 'user-123' } - let(:user) do - described_class.new(username, name, email, gl_id) - end - - subject { described_class.new(username, name, email, gl_id) } - - describe '.from_gitaly' do - let(:gitaly_user) do - Gitaly::User.new(gl_username: username, name: name.b, email: email.b, gl_id: gl_id) - end - - subject { described_class.from_gitaly(gitaly_user) } - - it { expect(subject).to eq(user) } - end - - describe '#==' do - def eq_other(username, name, email, gl_id) - eq(described_class.new(username, name, email, gl_id)) - end - - it { expect(subject).to eq_other(username, name, email, gl_id) } - - it { expect(subject).not_to eq_other(nil, nil, nil, nil) } - it { expect(subject).not_to eq_other(username + 'x', name, email, gl_id) } - it { expect(subject).not_to eq_other(username, name + 'x', email, gl_id) } - it { expect(subject).not_to eq_other(username, name, email + 'x', gl_id) } - it { expect(subject).not_to eq_other(username, name, email, gl_id + 'x') } - end - - describe '#git_env' do - let(:git_env) { subject.git_env } - - it 'returns the user environment variables' do - expect(git_env['GIT_COMMITTER_NAME']).to eq(name) - expect(git_env['GIT_COMMITTER_EMAIL']).to eq(email) - expect(git_env['GL_ID']).to eq(gl_id) - end - end -end |