Class: FeatureBranchTest

Inherits:
MiniTest::Unit::TestCase
  • Object
show all
Defined in:
lib/gitdummy/tests/feature_branch_test.rb

Instance Method Summary collapse

Instance Method Details

#test_branch_of_origin_masterObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/gitdummy/tests/feature_branch_test.rb', line 3

def test_branch_of_origin_master
  head = $repo.head.commit
  origin_master_id = $repo.remotes.find{|r| r.name == 'origin/master'}.commit.id

  current = head
  found = false

  while !found && current do
    if current.id == origin_master_id
      found = true
    end

    current = current.parents.first
  end

  assert found, "Your current branch is outdated and needs a rebase to the origin/master branch with `git rebase origin/master`."
end