OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Fix flaky test
Christophe Bliard032f32b85b5a
diff --git a/spec/lib/chronic_duration_spec.rb b/spec/lib/chronic_duration_spec.rbindex b2e56c36a65..2c2b3e102c9 100644--- a/spec/lib/chronic_duration_spec.rb+++ b/spec/lib/chronic_duration_spec.rb@@ -57,6 +57,12 @@ RSpec.describe ChronicDuration do}context "when string can't be parsed" do+ let(:raise_exception) { false }++ before do+ allow(described_class).to receive(:raise_exceptions).and_return(raise_exception)+ end+it "returns nil" doexpect(described_class.parse("gobblygoo")).to be_nilend@@ -66,10 +72,10 @@ RSpec.describe ChronicDuration doendcontext "when @@raise_exceptions set to true" do+ let(:raise_exception) { true }+it "raises with ChronicDuration::DurationParseError" do- described_class.raise_exceptions = trueexpect { described_class.parse("23 gobblygoos") }.to raise_error(ChronicDuration::DurationParseError)- described_class.raise_exceptions = falseendendend