{"action":"opened","issue":{"url":"https://api.github.com/repos/scalatest/scalatest/issues/1172","repository_url":"https://api.github.com/repos/scalatest/scalatest","labels_url":"https://api.github.com/repos/scalatest/scalatest/issues/1172/labels{/name}","comments_url":"https://api.github.com/repos/scalatest/scalatest/issues/1172/comments","events_url":"https://api.github.com/repos/scalatest/scalatest/issues/1172/events","html_url":"https://github.com/scalatest/scalatest/issues/1172","id":237753528,"number":1172,"title":"scalatest.concurrent.ScalaFutures.futureValue throws TestFailedException for failed futures","user":{"login":"Woodz","id":966157,"avatar_url":"https://avatars0.githubusercontent.com/u/966157?v=3","gravatar_id":"","url":"https://api.github.com/users/Woodz","html_url":"https://github.com/Woodz","followers_url":"https://api.github.com/users/Woodz/followers","following_url":"https://api.github.com/users/Woodz/following{/other_user}","gists_url":"https://api.github.com/users/Woodz/gists{/gist_id}","starred_url":"https://api.github.com/users/Woodz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Woodz/subscriptions","organizations_url":"https://api.github.com/users/Woodz/orgs","repos_url":"https://api.github.com/users/Woodz/repos","events_url":"https://api.github.com/users/Woodz/events{/privacy}","received_events_url":"https://api.github.com/users/Woodz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-22T07:21:24Z","updated_at":"2017-06-22T07:21:24Z","closed_at":null,"body":"The following test fails with Scalatest 3.0.1\r\n```\r\n        trait Foo {\r\n          def bar: Future[Boolean]\r\n        }\r\n        \r\n        val mockFoo = mock[Foo]\r\n        when(mockFoo.bar).thenReturn(Future.failed(new IOException(\"baz\")))\r\n\r\n        an[IOException] shouldBe thrownBy {\r\n          mockFoo.bar.futureValue\r\n        }\r\n```\r\n\r\n> Expected exception java.io.IOException to be thrown, but org.scalatest.exceptions.TestFailedException was thrown\r\n\r\nHowever, according to the documentation, `futureValue` should throw the failed future exception.\r\n\r\n>      * @throws Throwable if once ready, the <code>value</code> of this future is defined as a\r\n     *       <code>Left</code> (in this case, this method throws that same exception)\r\n\r\n(https://github.com/scalatest/scalatest/blob/d40d278f2bb8e73431b942d87881fb6dbab75cb9/scalatest/src/main/scala/org/scalatest/concurrent/Futures.scala#L347)"}}
{"actor":{"display_login":"Woodz"}}