Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can use a form like:

  assert_that(foo, is_equal_to(bar));
Which makes it sort of clear that foo is the actual value, and bar is the expected. Especially when you also see things like:

  assert_that(foo, is_not_zero());
Perhaps that's what you mean by 'BDD-style interfaces'.


> Perhaps that's what you mean by 'BDD-style interfaces'.

Yes. It's usually a more OO shape but usually along the lines of `foo.should.be.equal.to(bar)` or somesuch, a "natural" reading makes it pretty likely the parameter is the expected value.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: