{"action":"created","issue":{"url":"https://api.github.com/repos/pester/Pester/issues/1056","repository_url":"https://api.github.com/repos/pester/Pester","labels_url":"https://api.github.com/repos/pester/Pester/issues/1056/labels{/name}","comments_url":"https://api.github.com/repos/pester/Pester/issues/1056/comments","events_url":"https://api.github.com/repos/pester/Pester/issues/1056/events","html_url":"https://github.com/pester/Pester/issues/1056","id":328701466,"node_id":"MDU6SXNzdWUzMjg3MDE0NjY=","number":1056,"title":"Should Throw not detecting exceptions thrown from inside classes.","user":{"login":"LethiferousMoose","id":24547864,"node_id":"MDQ6VXNlcjI0NTQ3ODY0","avatar_url":"https://avatars2.githubusercontent.com/u/24547864?v=4","gravatar_id":"","url":"https://api.github.com/users/LethiferousMoose","html_url":"https://github.com/LethiferousMoose","followers_url":"https://api.github.com/users/LethiferousMoose/followers","following_url":"https://api.github.com/users/LethiferousMoose/following{/other_user}","gists_url":"https://api.github.com/users/LethiferousMoose/gists{/gist_id}","starred_url":"https://api.github.com/users/LethiferousMoose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LethiferousMoose/subscriptions","organizations_url":"https://api.github.com/users/LethiferousMoose/orgs","repos_url":"https://api.github.com/users/LethiferousMoose/repos","events_url":"https://api.github.com/users/LethiferousMoose/events{/privacy}","received_events_url":"https://api.github.com/users/LethiferousMoose/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-02T01:37:48Z","updated_at":"2018-06-04T05:06:52Z","closed_at":"2018-06-04T05:06:33Z","author_association":"NONE","body":"Operating System, Pester version and PowerShell version:\r\n\r\n```powershell\r\nPester version     : 4.3.1 C:\\Program Files\\PowerShell\\Modules\\Pester\\4.3.1\\Pester.psd1\r\nPowerShell version : 6.1.0-preview.2\r\nOS version         : Microsoft Windows NT 10.0.16299.0\r\n```\r\n\r\n## Expected Behavior\r\n\r\nIf a function tested in a PowerShell module calls a PowerShell class that throws an exception, Should Throw should detect it.\r\n\r\n## Current Behavior\r\n\r\nIf I call a function from pester than in turn calls a PowerShell class method that throws an exception, Should Throw is not detecting that any exception occurred.\r\n\r\n(assume defined in a module)\r\n```powershell\r\nclass SomeClass {\r\n   [void] Init() {\r\n      $this.SomeMethod();\r\n   }\r\n\r\n   hidden [void] SomeMethod() {\r\n      throw [SomeException]::new();\r\n   }\r\n}\r\n\r\nfunction ThrowsException {\r\n   [SomeClass] $someClass = [SomeClass]::new()\r\n   $someClass.Init();\r\n}\r\n```\r\n\r\n(assume test is run InModuleScope)\r\n```powershell\r\nDescribe -Name 'test' {\r\n    It 'SomeTest' {\r\n        {ThrowsException} | Should Throw\r\n    }\r\n}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/pester/Pester/issues/comments/394235356","html_url":"https://github.com/pester/Pester/issues/1056#issuecomment-394235356","issue_url":"https://api.github.com/repos/pester/Pester/issues/1056","id":394235356,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDIzNTM1Ng==","user":{"login":"LethiferousMoose","id":24547864,"node_id":"MDQ6VXNlcjI0NTQ3ODY0","avatar_url":"https://avatars2.githubusercontent.com/u/24547864?v=4","gravatar_id":"","url":"https://api.github.com/users/LethiferousMoose","html_url":"https://github.com/LethiferousMoose","followers_url":"https://api.github.com/users/LethiferousMoose/followers","following_url":"https://api.github.com/users/LethiferousMoose/following{/other_user}","gists_url":"https://api.github.com/users/LethiferousMoose/gists{/gist_id}","starred_url":"https://api.github.com/users/LethiferousMoose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LethiferousMoose/subscriptions","organizations_url":"https://api.github.com/users/LethiferousMoose/orgs","repos_url":"https://api.github.com/users/LethiferousMoose/repos","events_url":"https://api.github.com/users/LethiferousMoose/events{/privacy}","received_events_url":"https://api.github.com/users/LethiferousMoose/received_events","type":"User","site_admin":false},"created_at":"2018-06-04T05:06:52Z","updated_at":"2018-06-04T05:06:52Z","author_association":"NONE","body":"Found my problem, pester working as expected."}}
{"actor":{"display_login":"LethiferousMoose"}}