{"action":"created","issue":{"url":"https://api.github.com/repos/pester/Pester/issues/1118","repository_url":"https://api.github.com/repos/pester/Pester","labels_url":"https://api.github.com/repos/pester/Pester/issues/1118/labels{/name}","comments_url":"https://api.github.com/repos/pester/Pester/issues/1118/comments","events_url":"https://api.github.com/repos/pester/Pester/issues/1118/events","html_url":"https://github.com/pester/Pester/issues/1118","id":369578652,"node_id":"MDU6SXNzdWUzNjk1Nzg2NTI=","number":1118,"title":"Should broken in Mocks?","user":{"login":"scorpionlion","id":15209474,"node_id":"MDQ6VXNlcjE1MjA5NDc0","avatar_url":"https://avatars0.githubusercontent.com/u/15209474?v=4","gravatar_id":"","url":"https://api.github.com/users/scorpionlion","html_url":"https://github.com/scorpionlion","followers_url":"https://api.github.com/users/scorpionlion/followers","following_url":"https://api.github.com/users/scorpionlion/following{/other_user}","gists_url":"https://api.github.com/users/scorpionlion/gists{/gist_id}","starred_url":"https://api.github.com/users/scorpionlion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scorpionlion/subscriptions","organizations_url":"https://api.github.com/users/scorpionlion/orgs","repos_url":"https://api.github.com/users/scorpionlion/repos","events_url":"https://api.github.com/users/scorpionlion/events{/privacy}","received_events_url":"https://api.github.com/users/scorpionlion/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-12T14:34:42Z","updated_at":"2018-10-12T18:04:26Z","closed_at":null,"author_association":"NONE","body":"## 1. General summary of the issue\r\n\r\n\"Should\" assertion not working correctly inside parameter filter of Mock assertion.\r\nI am using 4.3.1 version of Pester.\r\n\r\n## 2. Describe Your Environment\r\n\r\nDescribe \"Write-host-test\" {\r\n    It \"Outputs correctly formatted message\" {\r\n        # Arrange\r\n        $expectedText = \"test message\"\r\n        Mock Write-Host \r\n        \r\n        # Act\r\n        Write-Host $expectedText\r\n        # Assert\r\n        Assert-MockCalled Write-Host -Times 1 -ParameterFilter{$true | Should -Be $true} \r\n       \r\n    }\r\n}\r\n\r\n## 3. Expected Behavior\r\n\r\nthe test should pass\r\n\r\n## 4.Current Behavior\r\n\r\nthe test fails, whereas below test works \r\n\r\nDescribe \"Write-host-test\" {\r\n    It \"Outputs correctly formatted message\" {\r\n        # Arrange\r\n        $expectedText = \"test message\"\r\n        Mock Write-Host \r\n        \r\n        # Act\r\n        Write-Host $expectedText\r\n        # Assert\r\n        Assert-MockCalled Write-Host -Times 1 -ParameterFilter{$true -eq $true} \r\n        \r\n    }\r\n}\r\n\r\n## 5. Possible Solution\r\n\r\nNo idea yet\r\n\r\n## 6. Context\r\n\r\nmy existing tests are broken"},"comment":{"url":"https://api.github.com/repos/pester/Pester/issues/comments/429411049","html_url":"https://github.com/pester/Pester/issues/1118#issuecomment-429411049","issue_url":"https://api.github.com/repos/pester/Pester/issues/1118","id":429411049,"node_id":"MDEyOklzc3VlQ29tbWVudDQyOTQxMTA0OQ==","user":{"login":"dlwyatt","id":5107604,"node_id":"MDQ6VXNlcjUxMDc2MDQ=","avatar_url":"https://avatars0.githubusercontent.com/u/5107604?v=4","gravatar_id":"","url":"https://api.github.com/users/dlwyatt","html_url":"https://github.com/dlwyatt","followers_url":"https://api.github.com/users/dlwyatt/followers","following_url":"https://api.github.com/users/dlwyatt/following{/other_user}","gists_url":"https://api.github.com/users/dlwyatt/gists{/gist_id}","starred_url":"https://api.github.com/users/dlwyatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlwyatt/subscriptions","organizations_url":"https://api.github.com/users/dlwyatt/orgs","repos_url":"https://api.github.com/users/dlwyatt/repos","events_url":"https://api.github.com/users/dlwyatt/events{/privacy}","received_events_url":"https://api.github.com/users/dlwyatt/received_events","type":"User","site_admin":false},"created_at":"2018-10-12T18:04:26Z","updated_at":"2018-10-12T18:04:26Z","author_association":"MEMBER","body":"You shouldn't be using `Should` there.  Its purpose is to do nothing when the assertion passes, and to throw an exception when it fails (which is what the `It` command treats as its success / failure conditions).  `-ParameterFilter`, on the other hand, wants you to return `$true` or `$false`."}}
{"actor":{"display_login":"dlwyatt"}}