diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-05 16:54:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-05 16:54:15 +0300 |
commit | be834a25982746ffd85252ff502df42bb88cb9d5 (patch) | |
tree | b4d6a8ba0931e12fac08f05abea33a3b8ec2c8a2 /spec/lib/feature/definition_spec.rb | |
parent | ee925a3597f27e92f83a50937a64068109675b3d (diff) |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc32
Diffstat (limited to 'spec/lib/feature/definition_spec.rb')
-rw-r--r-- | spec/lib/feature/definition_spec.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/spec/lib/feature/definition_spec.rb b/spec/lib/feature/definition_spec.rb index 49224cf4279..fa0207d829a 100644 --- a/spec/lib/feature/definition_spec.rb +++ b/spec/lib/feature/definition_spec.rb @@ -105,6 +105,7 @@ RSpec.describe Feature::Definition do describe '.load_all!' do let(:store1) { Dir.mktmpdir('path1') } let(:store2) { Dir.mktmpdir('path2') } + let(:definitions) { {} } before do allow(described_class).to receive(:paths).and_return( @@ -115,28 +116,30 @@ RSpec.describe Feature::Definition do ) end + subject { described_class.send(:load_all!) } + it "when there's no feature flags a list of definitions is empty" do - expect(described_class.load_all!).to be_empty + is_expected.to be_empty end it "when there's a single feature flag it properly loads them" do write_feature_flag(store1, path, yaml_content) - expect(described_class.load_all!).to be_one + is_expected.to be_one end it "when the same feature flag is stored multiple times raises exception" do write_feature_flag(store1, path, yaml_content) write_feature_flag(store2, path, yaml_content) - expect { described_class.load_all! } + expect { subject } .to raise_error(/Feature flag 'feature_flag' is already defined/) end it "when one of the YAMLs is invalid it does raise exception" do write_feature_flag(store1, path, '{}') - expect { described_class.load_all! } + expect { subject } .to raise_error(/Feature flag is missing name/) end |