Let's bikeshed std.experimental.testing assertions/checks/whatchamacallits

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 3 08:22:46 PDT 2015


On 03/07/15 16:07, linkrope wrote:

> 3. 'should' seems to be obsolete
>
> Now, 'expect' should be used for expectations:
>
> http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/

As far as I know, the only reason for that is that "should" is monkey 
patched on every class. This can cause problems if "method_missing" is 
implemented. D doesn't have this problem since "should" is not monkey 
patched on anything. In this code "should" is implemented like a free 
function and UFCS is used to get the same syntax as in Ruby. If there 
are problems with opDispatch/alias this (the D version of 
method_missing) then the regular function call syntax can be used.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list