On Wed, Sep 7, 2011 at 4:17 AM, NARUSE, Yui <naruse / airemix.jp> wrote: > I don't think RubySpec (RSpec syntax) is beautiful. > I want to write assertion with declarative. > > For example I can't find which is the expectation 4 or 5. > Fixnum#div coerces self and the given argument to Floats and returns > self divided by other as Fixnum FAILED > Expected 4 > to equal 5 I think this is part of the language barrier I sympathize with. It's a very terse way to say "I expected 5, but the code returned 4". I agree it might be a bit clearer to say "Expected 5 but got 4", but this is mostly a language issue; as written, it is correct, if confusing for you (and others). I'm starting to feel like the RubySpec resistance boils down to "it has too much English in it." > What you want to say seems MRI's test-all doesn't have implementation guards. > > But minitest has `skip` and we use it for platform dependent tests. > People can request test-all to add such skips but I didn't see such request. If test/unit could do something similar to mspec's guards, I would be happy with that. Working on RubySpec has taught me that we really need per-test guards, as in individual test methods. RubySpec accomplishes this by splitting specs up into isolated examples for each aspect of behavior, rather than test/* which often tests many things in a given method. However, I don't see any easy path toward accomplishing this. The current tests are structured with the expectation that an implementation must pass them en masse, and there's no way to break that up. For example...there are many test files for core classes that include SAFE level checks. JRuby will never pass those, since we have opted to leave SAFE unimplemented and fall back on JVM security. There's no easy way to filter out just the SAFE tests, which means we either have to comment them out and keep a local copy (that gets outdated) or build a complicated harness that can tell test/unit to skip certain test methods. That's what I get out of the box with RubySpec, so even though JRuby doesn't pass everything, we can maintain at some level and avoid regressing as we move forward. I propose a challenge: Show me how to get the current test/* tests to run on JRuby *green* without modifying JRuby. In other words, show me how to run MRI's tests on JRuby while filtering anything that doesn't currently pass. If that's not possible, how can JRuby make use of the test/* suite without already passing everything? And if JRuby can't make use of test/*, test/* is the wrong way to test Ruby. - Charlie