diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
commit | b39512ed755239198a9c294b6a45e65c05900235 (patch) | |
tree | d234a3efade1de67c46b9e5a38ce813627726aa7 /spec/lib/gitlab/version_info_spec.rb | |
parent | d31474cf3b17ece37939d20082b07f6657cc79a9 (diff) |
Add latest changes from gitlab-org/gitlab@15-3-stable-eev15.3.0-rc42
Diffstat (limited to 'spec/lib/gitlab/version_info_spec.rb')
-rw-r--r-- | spec/lib/gitlab/version_info_spec.rb | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/spec/lib/gitlab/version_info_spec.rb b/spec/lib/gitlab/version_info_spec.rb index 6ed094f11c8..078f952afad 100644 --- a/spec/lib/gitlab/version_info_spec.rb +++ b/spec/lib/gitlab/version_info_spec.rb @@ -79,11 +79,12 @@ RSpec.describe Gitlab::VersionInfo do describe '.unknown' do it { expect(@unknown).not_to be @v0_0_1 } it { expect(@unknown).not_to be described_class.new } - it { expect {@unknown > @v0_0_1}.to raise_error(ArgumentError) } - it { expect {@unknown < @v0_0_1}.to raise_error(ArgumentError) } + it { expect { @unknown > @v0_0_1 }.to raise_error(ArgumentError) } + it { expect { @unknown < @v0_0_1 }.to raise_error(ArgumentError) } end describe '.parse' do + it { expect(described_class.parse(described_class.new(1, 0, 0))).to eq(@v1_0_0) } it { expect(described_class.parse("1.0.0")).to eq(@v1_0_0) } it { expect(described_class.parse("1.0.0.1")).to eq(@v1_0_0) } it { expect(described_class.parse("1.0.0-ee")).to eq(@v1_0_0) } @@ -133,6 +134,20 @@ RSpec.describe Gitlab::VersionInfo do it { expect(@unknown.to_s).to eq("Unknown") } end + describe '.to_json' do + let(:correct_version) do + "{\"major\":1,\"minor\":0,\"patch\":1}" + end + + let(:unknown_version) do + "{\"major\":0,\"minor\":0,\"patch\":0}" + end + + it { expect(@v1_0_1.to_json).to eq(correct_version) } + it { expect(@v1_0_1_rc2.to_json).to eq(correct_version) } + it { expect(@unknown.to_json).to eq(unknown_version) } + end + describe '.hash' do it { expect(described_class.parse("1.0.0").hash).to eq(@v1_0_0.hash) } it { expect(described_class.parse("1.0.0.1").hash).to eq(@v1_0_0.hash) } |