adding another version with the expect_throw as a lambda