Skip to content

Commit

Permalink
rename module to vstspullrequestapprover
Browse files Browse the repository at this point in the history
  • Loading branch information
naeemkhedarun committed Apr 26, 2017
1 parent 96bf893 commit 82a2549
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Import-Module ./VstsPullRequest.psm1
Import-Module ./VstsPullRequestApprover.psm1

Describe "Set-PullRequestStatus" {
Context "When approving a pull request and the reviewer has permission" {
Mock -ModuleName VstsPullRequest Invoke-VSTSRestMethod `
Mock -ModuleName VstsPullRequestApprover Invoke-VSTSRestMethod `
-ParameterFilter { return $resourceUri.EndsWith("reviewers") } {
return @(@{ value = @{ displayName = "Reviewer"; id = "ReviewerId"; } })
}

Mock -ModuleName VstsPullRequest Invoke-VSTSRestMethod `
Mock -ModuleName VstsPullRequestApprover Invoke-VSTSRestMethod `
-ParameterFilter { return $resourceUri.Contains("ReviewerId`?") } {
$body | Should Be "{ vote: 10 }"
}

Mock -ModuleName VstsPullRequest Invoke-VSTSRestMethod `
Mock -ModuleName VstsPullRequestApprover Invoke-VSTSRestMethod `
-ParameterFilter { return $resourceUri.Contains("threads") } {
$body.Contains("Build Succeeded: https://teamcity/`?build-id=1") | Should Be $true
}
Expand All @@ -27,7 +27,7 @@ Describe "Set-PullRequestStatus" {
}

Context "When approving a pull request and the reviewer doesn't have permission" {
Mock -ModuleName VstsPullRequest Invoke-VSTSRestMethod `
Mock -ModuleName VstsPullRequestApprover Invoke-VSTSRestMethod `
-ParameterFilter { return $resourceUri.EndsWith("reviewers") } {
return @(@{ value = @{ displayName = "DifferentReviewer"; id = "ReviewerId"; } })
}
Expand All @@ -43,7 +43,7 @@ Describe "Set-PullRequestStatus" {
}

Describe "Get-VstsConnectionVariables" {
InModuleScope VstsPullRequest {
InModuleScope VstsPullRequestApprover {
Context "When called with a valid repository uri" {
$variables = Get-VstsConnectionVariables "https://domain.visualstudio.com/DefaultCollection/Project/_git/git-repository"

Expand All @@ -67,7 +67,7 @@ Describe "Get-VstsConnectionVariables" {
}

Describe "Get-VstsApiBaseUri" {
InModuleScope VstsPullRequest {
InModuleScope VstsPullRequestApprover {
Context "When called with a valid repository uri" {
$baseUri = Get-VstsApiBaseUri "https://domain.visualstudio.com/DefaultCollection/Project/_git/git-repository"

Expand All @@ -78,4 +78,4 @@ Describe "Get-VstsApiBaseUri" {
}
}

Remove-Module VstsPullRequest
Remove-Module VstsPullRequestApprover
File renamed without changes.

0 comments on commit 82a2549

Please sign in to comment.