Skip to content

Commit

Permalink
Add test for dry run pushes
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeweaver committed Nov 23, 2016
1 parent 0cd8e59 commit 4f99d65
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/lib/git/git_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ def mock_execute(stdout_andstderr_str, status, execution_count: 1, expected_comm
expect(@git.push).to eq(true)
end

it 'can push a branch using dry run' do
response = \
"To #{@git.repository_url}" \
'19087ab..9cdd9db master -> master'
mock_execute(response, 1, expected_command: '/usr/bin/git push --dry-run origin')
expect(@git.push(dry_run: true)).to eq(true)
end

it 'can detect if a push results in a no-op' do
mock_execute("Everything up-to-date\n", 1)
expect(@git.push).to eq(false)
Expand Down

0 comments on commit 4f99d65

Please sign in to comment.