Skip to content

Commit

Permalink
Rename platform_suffix to platform.
Browse files Browse the repository at this point in the history
  • Loading branch information
samsymons committed Jan 28, 2025
1 parent 4ffde1b commit e831a40
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions spec/ddg_apple_automation_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,50 +28,50 @@ def process_erb_template(erb_file_path, args)
describe "#compute_tag" do
describe "when is prerelease" do
let(:is_prerelease) { true }
let(:platform_suffix) { nil }
let(:platform) { nil }

it "computes tag and returns nil promoted tag" do
allow(File).to receive(:read).with("Configuration/Version.xcconfig").and_return("MARKETING_VERSION = 1.0.0")
allow(File).to receive(:read).with("Configuration/BuildNumber.xcconfig").and_return("CURRENT_PROJECT_VERSION = 123")
expect(compute_tag(is_prerelease, platform_suffix)).to eq(["1.0.0-123", nil])
expect(compute_tag(is_prerelease, platform)).to eq(["1.0.0-123", nil])
end
end

describe "when is public release" do
let(:is_prerelease) { false }
let(:platform_suffix) { nil }
let(:platform) { nil }

it "computes tag and promoted tag" do
allow(File).to receive(:read).with("Configuration/Version.xcconfig").and_return("MARKETING_VERSION = 1.0.0")
allow(File).to receive(:read).with("Configuration/BuildNumber.xcconfig").and_return("CURRENT_PROJECT_VERSION = 123")
expect(compute_tag(is_prerelease, platform_suffix)).to eq(["1.0.0", "1.0.0-123"])
expect(compute_tag(is_prerelease, platform)).to eq(["1.0.0", "1.0.0-123"])
end
end

describe "when is prerelease and includes platform suffix" do
let(:is_prerelease) { true }
let(:platform_suffix) { 'suffix' }
let(:platform) { 'suffix' }

it "computes tag and returns nil promoted tag" do
allow(File).to receive(:read).with("Configuration/Version.xcconfig").and_return("MARKETING_VERSION = 1.0.0")
allow(File).to receive(:read).with("Configuration/BuildNumber.xcconfig").and_return("CURRENT_PROJECT_VERSION = 123")
expect(compute_tag(is_prerelease, platform_suffix)).to eq(["1.0.0-123+suffix", nil])
expect(compute_tag(is_prerelease, platform)).to eq(["1.0.0-123+suffix", nil])
end
end

describe "when is public release and includes platform suffix" do
let(:is_prerelease) { false }
let(:platform_suffix) { 'suffix' }
let(:platform) { 'suffix' }

it "computes tag and returns nil promoted tag" do
allow(File).to receive(:read).with("Configuration/Version.xcconfig").and_return("MARKETING_VERSION = 1.0.0")
allow(File).to receive(:read).with("Configuration/BuildNumber.xcconfig").and_return("CURRENT_PROJECT_VERSION = 123")
expect(compute_tag(is_prerelease, platform_suffix)).to eq(["1.0.0+suffix", "1.0.0-123+suffix"])
expect(compute_tag(is_prerelease, platform)).to eq(["1.0.0+suffix", "1.0.0-123+suffix"])
end
end

def compute_tag(is_prerelease, platform_suffix)
Fastlane::Helper::DdgAppleAutomationHelper.compute_tag(is_prerelease, platform_suffix)
def compute_tag(is_prerelease, platform)
Fastlane::Helper::DdgAppleAutomationHelper.compute_tag(is_prerelease, platform)
end
end

Expand Down

0 comments on commit e831a40

Please sign in to comment.