News for hackers. Stuff that matters.
Re:Ruby Test::Unit sucks (and why I still use it) by joelmichael on Saturday December 18, 2010 @11:24PM (#2021082)
I find the assert_equal and so on much more readable than the "English" style. What does "should" mean? It's not as intuitive as assert.
Re:Ruby Test::Unit sucks (and why I still use it) by jrockway on Sunday December 19, 2010 @02:03AM (#2021297)
Yeah, rspec looks confusing as fuck. Here's how we do it in Perl:

    is $got, $expected, 'is got eq expected?';
    ok $foo, 'foo is true';
    like $some_string, qr/foo bar/, 'some string contains foo bar';
    cmp_ok $got, '<', $expected, 'got is less than expected';
No need to learn some new language. It's just Perl. (The only confusing part is whether it's $got, $expected or $expected, $got. But I guess that part is arbitrary, like calling "ok" "ok" instead of n"is_the_first_argument_some_sort_of_true_value".)
Re:Ruby Test::Unit sucks (and why I still use it) by viraptor on Sunday December 19, 2010 @08:10AM (#2021609)
But Test::More and others have other issues. How most modules do it in Perl usually means: by not cleaning global state between tests and without any isolation. It bit me so many and I wonder why people keep doing it that way.

I honestly expect a lot of cpan modules to have some tests that pass only because they don't run on a clean environment since I found some cases like that already.

Re:Ruby Test::Unit sucks (and why I still use it) by jrockway on Monday December 20, 2010 @05:19PM (#2025994)
I don't program with globals, so this have never been a problem. I also feel it's outside the scope of a discussion on syntax.

Finally, I am trying to fix this problem with: http://github.com/jrockway/eval-clean. It basically gives you an object that is a PerlInterpreter object, completely isolated inside. The only issue is keeping the lexical scope between eval calls, and I've almost figured out how to do this. (No, Lexical::Persistence is not even close to an acceptable solution :)