diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 15:26:25 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 15:26:25 +0300 |
commit | a09983ae35713f5a2bbb100981116d31ce99826e (patch) | |
tree | 2ee2af7bd104d57086db360a7e6d8c9d5d43667a /spec/lib/gitlab/regex_spec.rb | |
parent | 18c5ab32b738c0b6ecb4d0df3994000482f34bd8 (diff) |
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'spec/lib/gitlab/regex_spec.rb')
-rw-r--r-- | spec/lib/gitlab/regex_spec.rb | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/spec/lib/gitlab/regex_spec.rb b/spec/lib/gitlab/regex_spec.rb index 2f220272651..7aece6fe697 100644 --- a/spec/lib/gitlab/regex_spec.rb +++ b/spec/lib/gitlab/regex_spec.rb @@ -2,7 +2,7 @@ require 'fast_spec_helper' -describe Gitlab::Regex do +RSpec.describe Gitlab::Regex do shared_examples_for 'project/group name regex' do it { is_expected.to match('gitlab-ce') } it { is_expected.to match('GitLab CE') } @@ -262,6 +262,39 @@ describe Gitlab::Regex do it { is_expected.not_to match('!!()()') } end + describe '.maven_version_regex' do + subject { described_class.maven_version_regex } + + it { is_expected.to match('0')} + it { is_expected.to match('1') } + it { is_expected.to match('03') } + it { is_expected.to match('2.0') } + it { is_expected.to match('01.2') } + it { is_expected.to match('10.2.3-beta')} + it { is_expected.to match('1.2-SNAPSHOT') } + it { is_expected.to match('20') } + it { is_expected.to match('20.3') } + it { is_expected.to match('1.2.1') } + it { is_expected.to match('1.4.2-12') } + it { is_expected.to match('1.2-beta-2') } + it { is_expected.to match('12.1.2-2-1') } + it { is_expected.to match('1.1-beta-2') } + it { is_expected.to match('1.3.350.v20200505-1744') } + it { is_expected.to match('2.0.0.v200706041905-7C78EK9E_EkMNfNOd2d8qq') } + it { is_expected.to match('1.2-alpha-1-20050205.060708-1') } + it { is_expected.to match('703220b4e2cea9592caeb9f3013f6b1e5335c293') } + it { is_expected.to match('RELEASE') } + it { is_expected.not_to match('..1.2.3') } + it { is_expected.not_to match(' 1.2.3') } + it { is_expected.not_to match("1.2.3 \r\t") } + it { is_expected.not_to match("\r\t 1.2.3") } + it { is_expected.not_to match('1./2.3') } + it { is_expected.not_to match('1.2.3-4/../../') } + it { is_expected.not_to match('1.2.3-4%2e%2e%') } + it { is_expected.not_to match('../../../../../1.2.3') } + it { is_expected.not_to match('%2e%2e%2f1.2.3') } + end + describe '.semver_regex' do subject { described_class.semver_regex } |