module Test::Drive::GitHelper

Public Instance Methods

create_patch(filename) click to toggle source
# File lib/test/drive/git_helper.rb, line 9
def create_patch filename
  sh 'git pull --rebase'

  res = sh 'git diff --binary origin/master' do |stdout|
    File.open(filename, 'w') { |f| f.write stdout }
  end

  unless res == 0
    raise IOError.new 'Failed to create patch'
  end
end
delete_patch(filename) click to toggle source
# File lib/test/drive/git_helper.rb, line 21
def delete_patch filename
  File.delete filename
end
git_push() click to toggle source
# File lib/test/drive/git_helper.rb, line 25
def git_push
  sh 'git push origin'
end