Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix test where Export-Alias * fails when only single file exists#2953

Merged
mirichmo merged 2 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
adityapatwardhan:ExportAliasTestadityapatwardhan/PowerShell:ExportAliasTestCopy head branch name to clipboard
Jan 6, 2017
Merged

Fix test where Export-Alias * fails when only single file exists#2953
mirichmo merged 2 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
adityapatwardhan:ExportAliasTestadityapatwardhan/PowerShell:ExportAliasTestCopy head branch name to clipboard

Conversation

@adityapatwardhan

Copy link
Copy Markdown
Member

The test expects multiple files to be present at the location. We
explicitly create multiple files now under $TestDrive and use that the
location for Export-Alias
Also, so test structure changes.

The test expects multiple files to be present at the location. We
explicitly create multiple files now under $TestDrive and use that the
location for Export-Alias
Also, so test structure changes.
@adityapatwardhan

Copy link
Copy Markdown
Member Author

@JamesWTruher can you have a look.

}
}

Remove-Item -Path $testAliasDirectory -Recurse -Force

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove-Item -Path $testAliasDirectory -Recurse -Force [](start = 4, length = 53)

this should probably be removed as it's done automatically when $TESTDRIVE is cleaned up

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved.

BeforeEach {
New-Item -Path $testAliasDirectory -ItemType Directory -Force
New-Item -Path $testAliasDirectory -ItemType Directory -Force
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should probably add cleanup in an AfterEach as it looks like we're creating each time (and new-item -force doesn't remove the directory if it exists)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved.

@adityapatwardhan

Copy link
Copy Markdown
Member Author

@JamesWTruher Addressed CR comments.

@PowerShellTeam PowerShellTeam added the Review - Needed The PR is being reviewed label Jan 5, 2017
@JamesWTruher

Copy link
Copy Markdown
Collaborator

:shipit:

}
finally{
Remove-Item $TestDrive\foo -Force -ErrorAction SilentlyContinue
Remove-Item $TestDrive\bar -Force -ErrorAction SilentlyContinue

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$TestDrive is cleaned up automatically. Maybe remove this two lines?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$TestDrive is cleaned up only when the Describe or Context block is finished. These files are cleaned up in finally so that they do not interfere with other tests in subsequent It blocks.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok!

@mirichmo mirichmo merged commit a0bc987 into PowerShell:master Jan 6, 2017
@adityapatwardhan adityapatwardhan deleted the ExportAliasTest branch January 6, 2017 15:44
rjmholt pushed a commit to rjmholt/PowerShell that referenced this pull request Jan 9, 2017
…erShell#2953)

* Fix test where Export-Alias * fails when only single file exists

The test expects multiple files to be present at the location. We
explicitly create multiple files now under $TestDrive and use that the
location for Export-Alias
Also, so test structure changes.

* Address code review comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review - Needed The PR is being reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.