Skip to content

Commit

Permalink
remove untested code
Browse files Browse the repository at this point in the history
  • Loading branch information
wireframe committed Sep 19, 2014
1 parent 6e527d6 commit 0886fc5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 3 additions & 4 deletions lib/thegarage/gitx/cli/integrate_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
5 changes: 2 additions & 3 deletions spec/thegarage/gitx/cli/integrate_command_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0886fc5

Please sign in to comment.