[rspec-users] array order-agnostic matching?

Julian Leviston julian at leviston.net
Tue Feb 1 23:16:31 EST 2011

Sorry it was a knee-jerk reaction that was prompted by what you wrote, but not necessarily even connected to it.

Essentially, I've been wondering/thinking about this for a very long time (since about 15 years ago when I started writing smalltalk code).

I think a general principle of code is that it should be specced from the inside out and simultaneously from the outside in.

We have things like cucumber to generally spec from the outside in (ie define an interface according to the "user" what or whoever that may be), and we have things like rspec to spec from the inside out....

...however inside-out specs should be built inline with the code they spec, surely? I mean, just like you *should* have comments and documentation built in, the spec should almost build a bridge from the documentation to the code...

It seems rspec is incredibly close to this, much closer than cucumber is to be a very useable outside-in spec system.

Essentially I'd stipulate a flow of development that went something like this:

1. Plan
2. Put Plan and Documentation in source code with placeholders
3. Build Spec
4. Build Code

An architecture that, when bootstrapped, tests itself to make sure it's not borked before the code runs. (ie it does self-check on startup, essentially). 


On 02/02/2011, at 2:36 PM, James OBrien wrote:

> I don't fully understand this response..
> The private method I mentioned was a helper created by me in test code on the example group.
> Still very interested
>> On Feb 1, 2011 7:28 PM, "Julian Leviston" <julian at leviston.net> wrote:
>> Does this strike anyone else as odd?
>> Don't you think the test should actually be written IN to the code itself?
>> I guess I'm soft of stipulating a new language here, but perhaps Ruby is flexible enough to enable this.
>> Surely as the private methods of a class change, the testing code HAS to change... therefore isn't it best to actually write the rspec-level tests into the classes themselves as context-sensitive-optionally loaded or not depending on whether you're in testing mode or not
>> Julian
>> On 02/02/2011, at 4:01 AM, James OBrien wrote:
>> > additionally,
>> >
>> > since my
>> >
>> > foo.should_recei...
>> _______________________________________________
>> rspec-users mailing list
>> rspec-users at rubyforge.org
>> http://rubyforge.org/mailman/listinfo/rspec-users
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110202/36d56ab1/attachment-0001.html>

More information about the rspec-users mailing list