diff --git a/.gitignore b/.gitignore index 5f26532..8e0ab14 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ .rspec_status coverage *.gem +**/.DS_Store diff --git a/lib/arkana/models/config.rb b/lib/arkana/models/config.rb index 0e10efb..2cc9ab2 100644 --- a/lib/arkana/models/config.rb +++ b/lib/arkana/models/config.rb @@ -32,7 +32,7 @@ class Config # rubocop:disable Metrics/PerceivedComplexity, Metrics/CyclomaticComplexity def initialize(yaml) - @environments = (yaml["environments"] || []).map(&:capitalize) + @environments = (yaml["environments"] || []).map(&:capitalize_first_letter) @environment_secrets = yaml["environment_secrets"] || [] @global_secrets = yaml["global_secrets"] || [] default_name = "ArkanaKeys" diff --git a/spec/fixtures/arkana-fixture.yml b/spec/fixtures/arkana-fixture.yml index a9a683a..a59b7f9 100644 --- a/spec/fixtures/arkana-fixture.yml +++ b/spec/fixtures/arkana-fixture.yml @@ -11,6 +11,8 @@ package_manager: cocoapods environments: - debug - release + - debugPlusMore + - ReleasePlusMore global_secrets: - Domain - Global diff --git a/spec/models/config_spec.rb b/spec/models/config_spec.rb index 2d055d2..cba8531 100644 --- a/spec/models/config_spec.rb +++ b/spec/models/config_spec.rb @@ -28,7 +28,7 @@ context "when yaml configurations are provided" do it "should correctly assign each key/value pair to their respective property" do - expect(subject.environments).to eq %w[Debug Release] + expect(subject.environments).to eq %w[Debug Release DebugPlusMore ReleasePlusMore] expect(subject.environment_secrets).to eq %w[ServiceKey Server] expect(subject.global_secrets).to eq %w[Domain Global] custom_name = "MySecrets" @@ -64,7 +64,7 @@ context "when there is one or more environment secrets" do it "should generate a new key for each environment + environment secret pair" do - expect(subject.environment_keys.count).to eq(2 * 2) # There are 2 environments and 2 environment secrets + expect(subject.environment_keys.count).to eq(4 * 2) # There are 4 environments and 2 environment secrets end it "should have all keys with a prefix of the environment secret name" do