Skip to content

Commit febb35a

Browse files
authored
Merge pull request #115 from Shopify/at-git-main-branch
Fix main branch name when initializing a new test repo
2 parents 7ec98c1 + 2008664 commit febb35a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lib/spoom/test_helpers/project.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ def files
6262
# Actions
6363

6464
# Run `git init` in this project
65-
sig { void }
66-
def git_init
67-
Spoom::Git.exec("git init -q", path: path)
65+
sig { params(branch: String).void }
66+
def git_init(branch: "main")
67+
Spoom::Git.exec("git init -q -b #{branch}", path: path)
6868
Spoom::Git.exec("git config user.name 'spoom-tests'", path: path)
6969
Spoom::Git.exec("git config user.email 'spoom@shopify.com'", path: path)
7070
end

test/spoom/cli/coverage_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ def test_report_generate_html_file
421421

422422
def test_finish_on_original_branch
423423
create_git_history
424-
assert_equal("master", @project.current_branch)
424+
assert_equal("main", @project.current_branch)
425425
@project.create_and_checkout_branch("fake-branch")
426426
assert_equal("fake-branch", @project.current_branch)
427427
@project.bundle_exec("spoom coverage timeline --save")

test/spoom/git_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def test_git_log
8989
def test_git_rev_parse
9090
@project.write("file")
9191
@project.commit
92-
assert_match(/^[a-f0-9]+$/, Spoom::Git.rev_parse("master", path: @project.path).first.strip)
92+
assert_match(/^[a-f0-9]+$/, Spoom::Git.rev_parse("main", path: @project.path).first.strip)
9393
end
9494

9595
def test_git_show

0 commit comments

Comments
 (0)