www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Release fluent-asserts 0.6.0

reply Szabo Bogdan <szabobogdan3 gmail.com> writes:
Hi,

I just made a new release of fluent-asserts:

http://fluentasserts.szabobogdan.com/
https://code.dlang.org/packages/fluent-asserts

Since my last announcement I improved the library with:
  - better error messages
  - better exception api
  - integration with ranges
  - new asserts `executionTime` for callable and `containsOnly` 
for ranges
  - a new `Assert` utility for those who don't like the BDD style 
of writing asserts

Any feedback is appreciated.

Thanks,
Bogdan
Jul 02 2017
next sibling parent extrawurst <stephan extrawurst.org> writes:
On Sunday, 2 July 2017 at 13:34:25 UTC, Szabo Bogdan wrote:
 Hi,

 I just made a new release of fluent-asserts:

 http://fluentasserts.szabobogdan.com/
 https://code.dlang.org/packages/fluent-asserts

 Since my last announcement I improved the library with:
  - better error messages
  - better exception api
  - integration with ranges
  - new asserts `executionTime` for callable and `containsOnly` 
 for ranges
  - a new `Assert` utility for those who don't like the BDD 
 style of writing asserts

 Any feedback is appreciated.

 Thanks,
 Bogdan
Thanks Bogdan, I am using your lib regularly and especially appreciate the much better printing especially the actual value vs. expected. Cheers, Stephan
Jul 03 2017
prev sibling next sibling parent reply WebFreak001 <d.forum webfreak.org> writes:
On Sunday, 2 July 2017 at 13:34:25 UTC, Szabo Bogdan wrote:
 Hi,

 I just made a new release of fluent-asserts:

 http://fluentasserts.szabobogdan.com/
 https://code.dlang.org/packages/fluent-asserts

 Since my last announcement I improved the library with:
  - better error messages
  - better exception api
  - integration with ranges
  - new asserts `executionTime` for callable and `containsOnly` 
 for ranges
  - a new `Assert` utility for those who don't like the BDD 
 style of writing asserts

 Any feedback is appreciated.

 Thanks,
 Bogdan
Cool! I just tried it and it is really magic how good unittests can be, I love it showing the source code where it went wrong, I guess that might be a security risk but if anyone uses asserts in a production environment and it's leaking passwords it's their fault anyway. I am not really a fan of the a.should.be(b) thing but I like the Assert.equals() function, just looks more natural and easier to read to me + it is understandable by people who can't speak english better.
Jul 03 2017
parent Szabo Bogdan <szabobogdan yahoo.com> writes:
Thanks for the appreciation!


On Monday, 3 July 2017 at 15:07:48 UTC, WebFreak001 wrote:
 Cool!

 I just tried it and it is really magic how good unittests can 
 be, I love it showing the source code where it went wrong, I
Yes, a lot of programming languages have such assert libraries... and they are so helpful
 guess that might be a security risk but if anyone uses asserts 
 in a production environment and it's leaking passwords it's 
 their fault anyway.
If you are referring to the the fact that the source code is displayed, it should be ok, since if the files are not found near the test build, the code will not be displayed. Anyway... it might be a good idea to allow the library on the release build only if you provide a certain flag. Failing the release build if the library is included it might be useful since there is no reason to link it with the production code.
 I am not really a fan of the a.should.be(b) thing but I like 
 the Assert.equals() function, just looks more natural and 
 easier to read to me + it is understandable by people who can't 
 speak english better.
I thought that not anyone likes the BDD approach so I added `Assert`... I think it's good to have options
Jul 04 2017
prev sibling next sibling parent Soulsbane <paul acheronsoft.com> writes:
On Sunday, 2 July 2017 at 13:34:25 UTC, Szabo Bogdan wrote:
 Hi,

 I just made a new release of fluent-asserts:

 http://fluentasserts.szabobogdan.com/
 https://code.dlang.org/packages/fluent-asserts

 Since my last announcement I improved the library with:
  - better error messages
  - better exception api
  - integration with ranges
  - new asserts `executionTime` for callable and `containsOnly` 
 for ranges
  - a new `Assert` utility for those who don't like the BDD 
 style of writing asserts

 Any feedback is appreciated.

 Thanks,
 Bogdan
Great job with this! I absolutely love it. It's made my tests less ugly that's for sure. Why this kind of library isn't already a part of D is beyond me.
Jul 04 2017
prev sibling next sibling parent Jay Norwood <jayn prismnet.com> writes:
On Sunday, 2 July 2017 at 13:34:25 UTC, Szabo Bogdan wrote:

 Any feedback is appreciated.

 Thanks,
 Bogdan
Hi, if you're just looking for other ideas, you might want to look at adding capabilities like in the java hamcrest matchers. You might also want to support regular expression matches in the string matchers. http://hamcrest.org/JavaHamcrest/javadoc/1.3/org/hamcrest/Matchers.html These were used in swtbot, which made a very nice testing environment for their swt gui widgets. Swtbot added filtering for the context of the match as well. You can get a feel for it in this article. There is a DWT library translated from java swt, but this testing app wasn't ported. http://www.vogella.com/tutorials/SWTBot/article.html
Jul 07 2017
prev sibling parent Eric <eric makechip.com> writes:
On Sunday, 2 July 2017 at 13:34:25 UTC, Szabo Bogdan wrote:
 Hi,

 I just made a new release of fluent-asserts:

 http://fluentasserts.szabobogdan.com/
 https://code.dlang.org/packages/fluent-asserts

 Since my last announcement I improved the library with:
  - better error messages
  - better exception api
  - integration with ranges
  - new asserts `executionTime` for callable and `containsOnly`
This is great. It makes writing unit tests much less tedious. -Eric
Jul 08 2017