Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Better poshgit install and upgrade experience #48

Closed
wants to merge 4 commits into
from

Conversation

Projects
None yet
2 participants
Contributor

mwrock commented May 29, 2012

I made some changes to my own posh-hg package after noticing that upgrading to a new version can break the profile. I made some changes to:

  1. Ensure that any previous prompt logic that does not impact the physical prompt itself (eg. setting the window title to the current location) is preserved.
  2. Swallow the Write-host/output of all previous prompts
  3. Make updates replace the current posh-hg instead of adding the new one to the end

This also makes my posh-git-hg package more robust. If the same logic (in this pull request) could be added to poshgit, posh-git-hg would better handle scenarios where posh-hg is upgraded after posh-git-hg. Curently it would blow away any previous prompt logic. Of course I may be one of the very few impacted since my profile does change the window title to the current directory so my console2 tab names reflect their current directories.

I understand that there is alot of extra logic here (possibly making it morre error prone) for some perhaps insignificant edge cases. So I totally understand if you do not want to take it. I have also included some pester tests. The tests need to be run from the poshgit directory.

Owner

ferventcoder commented May 29, 2012

With pester tests....wow. Thanks This is good stuff. Do you edit the nuspec to include specific files?

Contributor

mwrock commented May 29, 2012

I did not. It should exclude the tests directory. I was not sure if you
wanted to update the nuspec yourself. BTW: the pester stuff is cool. I
first heard about it from a power point of yours I think. I want to look at
your patterns in Chocolatey. Testing PS is interesting since the nature of
PS is to manipulate all of the stuff that we would typically mock/stub/fake
away in normal unit tests.


From: "Rob Reynolds"
<reply+i-4788744-d9fee6b0245eab494d2249f985843964a35b0c0b-655165@reply.githu
b.com>

Sent: Tuesday, May 29, 2012 11:24 AM

To: "Matt Wrock" matt@mattwrock.com

Subject: Re: [nugetpackages] Better poshgit install and upgrade experience
(#48)

With pester tests....wow. Thanks This is good stuff. Do you edit the
nuspec to include specific files?


Reply to this email directly or view it on GitHub:

#48 (comment)

Owner

ferventcoder commented May 29, 2012

yes - working on making pester do automocking so you won't have to put down all of that boilerplate that I did. Each function is mocked out so you can determine what it should return to the function under test ( or system under test if you prefer that wording).

Likely a powerpoint of mine if you saw the last slide that said, I don't always test my friends. But when I do it sure as heck isn't in powershell. :D

Owner

ferventcoder commented Aug 7, 2012

Please check to be sure I didn't mess something up here. We may have duplicated some functionality...

Owner

ferventcoder commented Aug 7, 2012

Rebase wasn't exactly awesome...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment