From 0886fc561dc2e7ef3a21dd7fa8f4fb0ff1e528ae Mon Sep 17 00:00:00 2001 From: Ryan Sonnek Date: Fri, 19 Sep 2014 18:06:36 +0200 Subject: [PATCH] remove untested code --- lib/thegarage/gitx/cli/integrate_command.rb | 7 +++---- spec/thegarage/gitx/cli/integrate_command_spec.rb | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/thegarage/gitx/cli/integrate_command.rb b/lib/thegarage/gitx/cli/integrate_command.rb index 880ce49..6b8d1d3 100644 --- a/lib/thegarage/gitx/cli/integrate_command.rb +++ b/lib/thegarage/gitx/cli/integrate_command.rb @@ -10,7 +10,7 @@ class IntegrateCommand < BaseCommand desc 'integrate', 'integrate the current branch into one of the aggregate development branches (default = staging)' def integrate(target_branch = 'staging') branch = current_branch.name - assert_integratable_branch!(branch, target_branch) + assert_aggregate_branch!(target_branch) UpdateCommand.new.update @@ -27,9 +27,8 @@ def integrate(target_branch = 'staging') private - def assert_integratable_branch!(branch, target_branch) - assert_not_protected_branch!(branch, 'integrate') unless aggregate_branch?(target_branch) - raise "Only aggregate branches are allowed for integration: #{AGGREGATE_BRANCHES}" unless aggregate_branch?(target_branch) || target_branch == Thegarage::Gitx::BASE_BRANCH + def assert_aggregate_branch!(target_branch) + fail "Invalid aggregate branch: #{target_branch} must be one of supported aggregate branches #{AGGREGATE_BRANCHES}" unless aggregate_branch?(target_branch) end # nuke local branch and pull fresh version from remote repo diff --git a/spec/thegarage/gitx/cli/integrate_command_spec.rb b/spec/thegarage/gitx/cli/integrate_command_spec.rb index 985d064..2b0e5d4 100644 --- a/spec/thegarage/gitx/cli/integrate_command_spec.rb +++ b/spec/thegarage/gitx/cli/integrate_command_spec.rb @@ -55,10 +55,9 @@ should meet_expectations end end - context 'when target branch != staging || prototype' do + context 'when target branch is not an aggregate branch' do it 'raises an error' do - - expect { cli.integrate('some-other-branch') }.to raise_error(/Only aggregate branches are allowed for integration/) + expect { cli.integrate('some-other-branch') }.to raise_error(/Invalid aggregate branch: some-other-branch must be one of supported aggregate branches/) end end end