Skip to content

Add test coverage for Registry - #4354

Merged
Aditya Patwardhan (adityapatwardhan) merged 4 commits into
PowerShell:masterfrom
jeffbi:tests-4148-registry
Aug 2, 2017
Merged

Add test coverage for Registry#4354
Aditya Patwardhan (adityapatwardhan) merged 4 commits into
PowerShell:masterfrom
jeffbi:tests-4148-registry

Conversation

@jeffbi

@jeffbi jeffbi commented Jul 26, 2017

Copy link
Copy Markdown

Addresses parts of #4148

Add coverage for Get-Item, Get-ChildItem, Set-Item, and Clear-Item

Add coverage for Get-Item, Get-ChildItem, Set-Item, and Clear-Item
@SteveL-MSFT

Steve Lee (SteveL-MSFT) commented Jul 27, 2017

Copy link
Copy Markdown
Member

Missing tests:

  • invalid hive root
  • validate -whatif works for set-item and clear-item
  • attempt accessing path you don't have access to

@jeffbi

jeffbi commented Jul 28, 2017

Copy link
Copy Markdown
Author

Steve Lee (@SteveL-MSFT) These test run with the tag RequireAdminOnWindows. Is there a Registry path that admin would not have access to?

@SteveL-MSFT

Copy link
Copy Markdown
Member

jeffbi try HKLM:\sam

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor comment

$property."$testPropertyName" | Should Be 0
}

It "Verity Clear-Item" {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Typo Verity->Verify

$key.Property.Length | Should BeExactly 0
}

It "Verity Clear-Item with -WhatIf" {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Typo here has well Verify

@jeffbi

jeffbi commented Jul 28, 2017

Copy link
Copy Markdown
Author

Typos fixed.

The Travis failure seems to be in a test for Invoke-Item.

@SteveL-MSFT

Steve Lee (SteveL-MSFT) commented Jul 28, 2017

Copy link
Copy Markdown
Member

jeffbi I have a PR to change the invoke-item tests to Feature as they shouldn't be CI anyways, I'll restart the Mac job, there's a chance it'll pass as it's a timing issue

@SteveL-MSFT Steve Lee (SteveL-MSFT) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@adityapatwardhan
Aditya Patwardhan (adityapatwardhan) merged commit 19fcd43 into PowerShell:master Aug 2, 2017
@jeffbi
jeffbi deleted the tests-4148-registry branch August 2, 2017 18:21
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
* Add test coverage for Registry (PowerShell#4148)

* Add coverage for Get-Item, Get-ChildItem, Set-Item, and Clear-Item

* Add test for accessing inaccessible path, per code review.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants