Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capitalize only first letter of Environment identifier #19

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
.rspec_status
coverage
*.gem
**/.DS_Store
2 changes: 1 addition & 1 deletion lib/arkana/models/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions spec/fixtures/arkana-fixture.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ package_manager: cocoapods
environments:
- debug
- release
- debugPlusMore
- ReleasePlusMore
global_secrets:
- Domain
- Global
Expand Down
4 changes: 2 additions & 2 deletions spec/models/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down