summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorAleksei Lipniagov <alipniagov@gitlab.com>2019-09-11 18:32:24 +0000
committerKamil TrzciƄski <ayufan@ayufan.eu>2019-09-11 18:32:24 +0000
commit50cb6eca570a352a3b9799a66f77edad261763be (patch)
treed5157634a5100ca6900a3dc8d7b0b806caf39ca5 /spec/lib
parent6db9cbfe77a556ea2d321f0ea0a0c6b6e14a817c (diff)
downloadgitlab-ce-50cb6eca570a352a3b9799a66f77edad261763be.tar.gz
Use 'gitlab_chronic_duration' gem
Replace 'chronic_duration' to 'gitlab_chronic_duration', to make relevant method calls thread-safe.
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/ci/config/entry/rules/rule_spec.rb2
-rw-r--r--spec/lib/gitlab/patch/chronic_duration_spec.rb27
2 files changed, 1 insertions, 28 deletions
diff --git a/spec/lib/gitlab/ci/config/entry/rules/rule_spec.rb b/spec/lib/gitlab/ci/config/entry/rules/rule_spec.rb
index c25344ec1a4..18037a5612c 100644
--- a/spec/lib/gitlab/ci/config/entry/rules/rule_spec.rb
+++ b/spec/lib/gitlab/ci/config/entry/rules/rule_spec.rb
@@ -1,5 +1,5 @@
require 'fast_spec_helper'
-require 'chronic_duration'
+require 'gitlab_chronic_duration'
require 'support/helpers/stub_feature_flags'
require_dependency 'active_model'
diff --git a/spec/lib/gitlab/patch/chronic_duration_spec.rb b/spec/lib/gitlab/patch/chronic_duration_spec.rb
deleted file mode 100644
index 541037ec1a2..00000000000
--- a/spec/lib/gitlab/patch/chronic_duration_spec.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-describe Gitlab::Patch::ChronicDuration do
- subject { ChronicDuration.parse('1mo') }
-
- it 'uses default conversions' do
- expect(subject).to eq(2_592_000)
- end
-
- context 'with custom conversions' do
- before do
- ChronicDuration.hours_per_day = 8
- ChronicDuration.days_per_week = 5
- end
-
- after do
- ChronicDuration.hours_per_day = 24
- ChronicDuration.days_per_week = 7
- end
-
- it 'uses custom conversions' do
- expect(subject).to eq(576_000)
- end
- end
-end