开发者

Is there something similar to Igloo's LastException in GoogleTest?

开发者 https://www.devze.com 2023-04-03 18:02 出处:网络
I\'m taking a look at TDD using GoogleTest and I was doing this kata: http://osherove.com/tdd-kata-1.

I'm taking a look at TDD using GoogleTest and I was doing this kata: http://osherove.com/tdd-kata-1.

One of the steps is to throw an exception with a specific string. I know I can test for a thrown exception with ASSERT_THROW or EXPECT_THROW, but how can I test the exception message?

I've seen one of the solutions uses Igloo and its LastException, to 开发者_高级运维get the last exception thrown and check its contents.

Is there something similar in GoogleTest?


Nope, for more info check out ROS Wiki for what they've done to get around it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号