Skip to content

Commit

Permalink
test: fix feature specs to align with #89
Browse files Browse the repository at this point in the history
PR #89 fixed bug GH-88 but resulted in broken
specs left over from when we supported the
.gitmessage approach
  • Loading branch information
davidalpert committed Oct 26, 2022
1 parent 7237c62 commit c23fb54
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 50 deletions.
17 changes: 2 additions & 15 deletions features/git-mob/bugs/41-gitmessage-accumulates-authors.feature
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,6 @@ Feature: 🐛 gitmessage accumulates authors over time
Scenario: starting update ~/.gitmessage but does not configure commit.template
Given I cd to "example"
And I run `git mob ad`
And the file "~/.gitmessage" should contain:
"""
Co-authored-by: Amy Doe <amy@findmypast.com>
"""
And the file "~/.gitmessage" should not contain "Co-authored-by"
When I successfully run `git mob bd`
Then the file "~/.gitmessage" should contain:
"""
Co-authored-by: Bob Doe <bob@findmypast.com>
"""
And the file "~/.gitmessage" should not contain:
"""
Co-authored-by: Amy Doe <amy@findmypast.com>
"""
And the file "~/.gitmessage" should not contain "Co-authored-by"
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ Feature: 🐛 co-authors not cleared from message template when returning to git

Scenario:
Given I successfully run `git mob ad`
And the file "~/.gitmessage" should contain:
"""
Co-authored-by: Amy Doe <amy@findmypast.com>
"""
And the file "~/.gitmessage" should not contain "Co-authored-by"
When I successfully run `git solo`
And the file "~/.gitmessage" should not contain "Co-authored-by"
6 changes: 1 addition & 5 deletions features/git-mob/message.feature
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ Feature: message
Jane Doe <jane@example.com>
Amy Doe <amy@findmypast.com>
"""
And the file "~/.gitmessage" should contain:
"""
Co-authored-by: Amy Doe <amy@findmypast.com>
"""
And the file "~/.gitmessage" should not contain "Co-authored-by:"
And the file ".git/config" should not contain:
"""
template = ~/.gitmessage
Expand Down
30 changes: 5 additions & 25 deletions features/git-mob/parity/git-mob.feature
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,9 @@ Feature: git-mob.spec
Jane Doe <jane@example.com>
Bob Doe <bob@example.com>
"""
And a file named "~/.gitmessage" should contain:
"""
A commit title
A commit body that goes into more detail.
And a file named "~/.gitmessage" should not contain "Co-authored-by:"

Co-authored-by: Bob Doe <bob@example.com>
"""

Scenario: appends co-authors to an existing commit template
Scenario: does not append co-authors to an existing commit template
Given a simple git repo at "example"
And I cd to "example"
And a file named "~/.gitmessage" with:
Expand All @@ -151,27 +144,14 @@ Feature: git-mob.spec
A commit body that goes into more detail.
"""
When I successfully run `git mob ad bd`
And a file named "~/.gitmessage" should contain:
"""
A commit title
And a file named "~/.gitmessage" should not contain "Co-authored-by:"

A commit body that goes into more detail.
Co-authored-by: Amy Doe <amy@example.com>
Co-authored-by: Bob Doe <bob@example.com>
"""

Scenario: appends co-authors to a new commit template
Scenario: does not append co-authors to a new commit template
Given a simple git repo at "example"
And I cd to "example"
And a file named "~/.gitmessage" does not exist
When I successfully run `git mob ad bd`
And a file named "~/.gitmessage" should contain:
"""
Co-authored-by: Amy Doe <amy@example.com>
Co-authored-by: Bob Doe <bob@example.com>
"""
And a file named "~/.gitmessage" should not exist

@pending
# allow running some mob commands outside a working tree
Expand Down

0 comments on commit c23fb54

Please sign in to comment.