I would like to discuss this sketch summer of code application. Any
advices or critic will be wellcome.
Maybe this proposal is not a good idea. Is you think like that,
argues will be wellcome too. (im not sure this is a good idea or not)
Thanks.
== Cover the core of and VM with RSpec ==
=== Abstract ===
There are a number of Ruby implementations available today. The
“standard” implementation is the original C-language-based
implementation, written by Yukihiro M. (aka Matz), and now
maintained by him and a number of contributors. In the las year,
emerge differentes Ruby Virtual Machine (VM), YARV, Rubinius, JRuby,
Gardens Point Ruby .NET, XRuby or cardinal are some good examples
among others [1]. The goal of this proposal is create a common set of
specification (using rspec) for the Ruby core, that verification the
correct and same behaviour of the differents virtual machines. I would
like the specs be usable for any virtual machine implementation.
The goal in writing a spec is to describe the expected behavior from
the object. Each spec should describe one facet of the behavior. Specs
should prefer clarity and understanding over any other principle
Test Driven Development (TDD) has you define the behaviour of your
system by writing small tests that precisely define some small piece
of your system’s behaviour. Then you implement that behaviour. Then
you clean up & improve your design.
=== Benefits to the Community ===
…
=== The scheme : ===
language is for specs that describe language-level constructs.
core is for specs for any of the builtin classes in Ruby. These are
documented at RDoc Documentation.
The ruby core set :
language : assignament, class, expression, method, operators,
variables. exception
Though this is a huge - and needed - community service, I think you
should reconsider simply because it will really bore you (IMHO). Try
looking for something more interesting to do (There were many offers,
one of them mine, spread around the ml in the last few days).
More important would be a mechanism to run rspec in one
implementation and the tests in another. Pat blogged in an interview
that something like that was in the works but I’m not sure if it’s
done. Without it, a spec will be useless to an implementation that
cannot run rspec - which isn’t a trivial program to run. The beauty of
tests is being able to work with them throughout the whole path.
Also, there are a few spelling mistakes and a bit of missing grammar.
In general, I’d be happy if you’d do it because it would help all the
alternative implementations a lot and I’m waiting so impatiently for
rubinius
I would like to discuss this sketch summer of code application. Any
advices or critic will be wellcome.
Maybe this proposal is not a good idea. Is you think like that,
argues will be wellcome too. (im not sure this is a good idea or not)
Thanks.
Hi Pedro,
It’s great to see the interest in RSpec. Thanks!
I also think that this project could provide great value for the
implementors of other ruby implementations - having a single source
against which all rubies can be verified.
This doesn’t, however, feel like a good candidate for a TDD project to
me. TDD is about using tests to drive the behaviour and design of the
code in granular steps. What you seem to want is to create an
executable specification of an entire system that you can then use to
standardize other systems.
While I think that rspec is a reasonable candidate tool for your
project, you may also want to look at FitNesse (w/ ruby FIT).
Though this is a huge - and needed - community service, I think you
should reconsider simply because it will really bore you (IMHO). Try
looking for something more interesting to do (There were many offers,
one of them mine, spread around the ml in the last few days).
well enough, implementation is just a detail.
Right. For example, I’ve got this ostruct based class in Ruport that
I wanted to make act like HashWithIndifferentAccess.
Just like a good math problem, once you get the details well defined
and sorted out, the implementation is just route manual labor.
module Ruport
class Renderer::Options < OpenStruct
def
send(key)
end
def []=(key,value)
send(“#{key}=”,value)
end
end
end
I initially forgot about the []=, and my tests told me right away!
So if you look at most of my math, it’s like my code. I set
everything up the way I want it to work, which if you take that
approach, is almost all the effort. Then i just fill in the missing
pieces.
Could you show a few of these tests that are really problem solving by
themselves?
I think Greg just meant that with TDD, you tend to do more of your
thinking on the test writing side. Once you have the test framed
well enough, implementation is just a detail.