Skip to content

Commit

Permalink
intendation police
Browse files Browse the repository at this point in the history
  • Loading branch information
kshann committed Jan 28, 2025
1 parent 1ea14d8 commit 9816334
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions spec/ddg_apple_automation_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,53 +165,53 @@ def load_file(file)
end

it "prepares the release branch with version updates for iOS" do
platform = "ios"
version = "1.0.0"
release_branch_name = "release/#{platform}/#{version}"
other_action = double("other_action")
options = { some_option: "value" }
github_token = "github-token"
platform = "ios"
version = "1.0.0"
release_branch_name = "release/#{platform}/#{version}"
other_action = double("other_action")
options = { some_option: "value" }
github_token = "github-token"

@client = double("Octokit::Client")
allow(Octokit::Client).to receive(:new).and_return(@client)
allow(@client).to receive(:latest_release).and_return(double(tag_name: version))
allow(Fastlane::Helper).to receive(:is_ci?).and_return(false)
allow(Fastlane::Helper::GitHelper).to receive(:repo_name).and_return("iOS")
@client = double("Octokit::Client")
allow(Octokit::Client).to receive(:new).and_return(@client)
allow(@client).to receive(:latest_release).and_return(double(tag_name: version))
allow(Fastlane::Helper).to receive(:is_ci?).and_return(false)
allow(Fastlane::Helper::GitHelper).to receive(:repo_name).and_return("iOS")

allow(Fastlane::Helper::DdgAppleAutomationHelper).to receive(:code_freeze_prechecks)
allow(Fastlane::Helper::DdgAppleAutomationHelper).to receive(:validate_new_version)
.with(version).and_return(version)
allow(Fastlane::Helper::DdgAppleAutomationHelper).to receive(:code_freeze_prechecks)
allow(Fastlane::Helper::DdgAppleAutomationHelper).to receive(:validate_new_version)
.with(version).and_return(version)

allow(Fastlane::Helper::DdgAppleAutomationHelper).to receive(:create_release_branch)
.with(platform, version).and_return(release_branch_name)
allow(Fastlane::Helper::DdgAppleAutomationHelper).to receive(:create_release_branch)
.with(platform, version).and_return(release_branch_name)

allow(Fastlane::Helper::DdgAppleAutomationHelper).to receive(:update_embedded_files)
.with(platform, other_action)
allow(Fastlane::Helper::DdgAppleAutomationHelper).to receive(:update_embedded_files)
.with(platform, other_action)

allow(Fastlane::Helper::DdgAppleAutomationHelper).to receive(:update_version_and_build_number_config)
.with(version, 0, other_action)
allow(Fastlane::Helper::DdgAppleAutomationHelper).to receive(:update_version_and_build_number_config)
.with(version, 0, other_action)

allow(Fastlane::Helper::DdgAppleAutomationHelper).to receive(:update_root_plist_version)
.with(version, other_action)
allow(Fastlane::Helper::DdgAppleAutomationHelper).to receive(:update_root_plist_version)
.with(version, other_action)

allow(Fastlane::Helper::GitHubActionsHelper).to receive(:set_output)
allow(Fastlane::Helper::GitHubActionsHelper).to receive(:set_output)

expect(other_action).to receive(:push_to_git_remote)
expect(other_action).to receive(:push_to_git_remote)

result_branch, result_version = Fastlane::Helper::DdgAppleAutomationHelper.prepare_release_branch(
platform, version, other_action
)
result_branch, result_version = Fastlane::Helper::DdgAppleAutomationHelper.prepare_release_branch(
platform, version, other_action
)

expect(result_branch).to eq("release/ios/1.0.0")
expect(result_version).to eq(version)
expect(result_branch).to eq("release/ios/1.0.0")
expect(result_version).to eq(version)

expect(Fastlane::Helper::DdgAppleAutomationHelper).to have_received(:code_freeze_prechecks)
expect(Fastlane::Helper::DdgAppleAutomationHelper).to have_received(:validate_new_version).with(version)
expect(Fastlane::Helper::DdgAppleAutomationHelper).to have_received(:create_release_branch).with(platform, version)
expect(Fastlane::Helper::DdgAppleAutomationHelper).to have_received(:update_embedded_files).with(platform, other_action)
expect(Fastlane::Helper::DdgAppleAutomationHelper).to have_received(:update_version_and_build_number_config).with(version, 0, other_action)
expect(Fastlane::Helper::DdgAppleAutomationHelper).to have_received(:update_root_plist_version).with(version, other_action)
expect(Fastlane::Helper::GitHubActionsHelper).to have_received(:set_output).with("release_branch_name", release_branch_name)
expect(Fastlane::Helper::DdgAppleAutomationHelper).to have_received(:code_freeze_prechecks)
expect(Fastlane::Helper::DdgAppleAutomationHelper).to have_received(:validate_new_version).with(version)
expect(Fastlane::Helper::DdgAppleAutomationHelper).to have_received(:create_release_branch).with(platform, version)
expect(Fastlane::Helper::DdgAppleAutomationHelper).to have_received(:update_embedded_files).with(platform, other_action)
expect(Fastlane::Helper::DdgAppleAutomationHelper).to have_received(:update_version_and_build_number_config).with(version, 0, other_action)
expect(Fastlane::Helper::DdgAppleAutomationHelper).to have_received(:update_root_plist_version).with(version, other_action)
expect(Fastlane::Helper::GitHubActionsHelper).to have_received(:set_output).with("release_branch_name", release_branch_name)
end
end

Expand Down

0 comments on commit 9816334

Please sign in to comment.