Thread overview
New fluent asserts library for D
Mar 15
Seb
March 15
Hey guys!

My new job has some room for me to use D at work, so before I do anything serious there I've been trying to work through some personal projects. The vast majority of my day job is Java, and I've really been enjoying the AssertJ library (http://joel-costigliola.github.io/assertj/) in my unit tests, and thought it was a shame that I couldn't find something similar for D.

Here's what I've come up with so far: https://github.com/NickPapanastasiou/describe

Obviously still in very early stages. At the moment, docs are lacking and failure messages need to be made clear, but it's fairly usable. Any and all feedback is welcome and appreciated!
March 15
On Friday, 15 March 2019 at 03:04:39 UTC, Nick Papanastasiou wrote:
> Hey guys!
>
> My new job has some room for me to use D at work, so before I do anything serious there I've been trying to work through some personal projects. The vast majority of my day job is Java, and I've really been enjoying the AssertJ library (http://joel-costigliola.github.io/assertj/) in my unit tests, and thought it was a shame that I couldn't find something similar for D.
>
> Here's what I've come up with so far: https://github.com/NickPapanastasiou/describe
>
> Obviously still in very early stages. At the moment, docs are lacking and failure messages need to be made clear, but it's fairly usable. Any and all feedback is welcome and appreciated!

Why not make AssertBuilder a struct instead of a class?  Doing so allows it to be used with @nogc/betterC, and you're not making more garbage for the GC to clean up later.

March 15
On Friday, 15 March 2019 at 03:04:39 UTC, Nick Papanastasiou wrote:
> and thought it was a shame that I couldn't find something similar for D.

Did you have a look at fluent-asserts?

https://code.dlang.org/packages/fluent-asserts
March 15
On Friday, 15 March 2019 at 10:35:59 UTC, Seb wrote:
> On Friday, 15 March 2019 at 03:04:39 UTC, Nick Papanastasiou wrote:
>> and thought it was a shame that I couldn't find something similar for D.
>
> Did you have a look at fluent-asserts?
>
> https://code.dlang.org/packages/fluent-asserts

I do not know the reason why it was not found, but searching for "assert" on code.dlang.org is not easy. Packages with "assert" in name have no priority. It is very easy to come to the conclusion there is no such  package.
Fluent-asserts is hidden somewhere on a long list with completely unrelated packages (mir, mysql, pegged, ...)

Kind regards
Andre
March 20
On Friday, 15 March 2019 at 10:35:59 UTC, Seb wrote:
> On Friday, 15 March 2019 at 03:04:39 UTC, Nick Papanastasiou wrote:
>> and thought it was a shame that I couldn't find something similar for D.
>
> Did you have a look at fluent-asserts?
>
> https://code.dlang.org/packages/fluent-asserts

Also dshould? https://code.dlang.org/packages/dshould

(Meant to run with unit-threaded.)