From: Marc-Andre Lafortune Date: 2011-09-05T03:54:32+09:00 Subject: [ruby-core:39260] RubySpec vs CRuby's test/... Before the release of Ruby 1.9.2 it was decided that Ruby releases would pass RubySpec, in addition to `make test` and `make test-all` which runs all `test/*` files. RubySpec is a project to write an executable specification for the Ruby Programming Language. As such, any test that is not implementation specific has its place in RubySpec. I feel that the Ruby community would benefit most if all new (implementation independent) tests were written in RubySpec instead of `test/*` for the following reasons: - tests improve all other implementations that use RubySpec (rubinius, JRuby, etc...) in addition to CRuby - tests are usually more readable, as the style of RubySpec encourages a more fine grained approach and written explanations - RubySpec makes for a good central reference point for users, again because it is better structured as well as typically more exhaustive and applies to all implementations. - as RubySpec aims to be as complete as possible, it encourages thinking about more cases (e.g. what happens if a block is passed), which makes for better new features. Moreover, I see no disadvantage in tests being contributed to RubySpec instead of `test/*`. In [ruby-core:39206], Yui Naruse says that he would gladly contribute to RubySpec for new tests if other committers can be persuaded. I'd note that he already contributes a lot through modifications to existing RubySpecs. In [ruby-core:39209], Urabe Shyouhei asks: > "So what's the test going to achieve? What's that test for?" said my > teacher another day. A test has a perspective. No test can be suitable > for everything. > > It seems to me RubySpec is meant to be a written behavioral description. > Which is not a bad thing of course, but I think Yui needs a regression > test instead. It does test CRuby's implementation but doesn't help him. I believe that most tests that are implementation independent are checks for general cases or boundary conditions and are specs of the language. These make perfect regression tests and they fit very well with RubySpec. So the questions to be answered are: - am I missing advantages to CRuby's `test/*`? - what are the reservations against adding tests to RubySpec? - is there anything that should be done to make it easier for CRuby's committers to add tests to RubySpec? Thanks, Marc-Andr�