Forum: RSpec getting started - very much a beginner

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D15a45a973443d4562051eb675b60474?d=identicon&s=25 Tom Cloyd (Guest)
on 2009-01-11 13:39
(Received via mailing list)
A hope my ignorance is acceptable here. I have, to this point,
programmed in Ruby mostly using my awareness of procedural programming;
I've written a small number of very useful programs for myself. I'm
starting to use classes now - just starting.

I have a small project I'm working on - setting up a database based on
the directed acyclic graph (DAG) model (using Ruby only). I'm been
studying test-directed development, which led me to BDD, at which point
I got really excited. I truly want to go forward with learning cucumber,
and rspec.

So here I am trying to started using cucumber, and I'm having a little
trouble. The documentation in the cucumber wiki isn't, to my poverty
stricken perception, at all procedural, although individual pages seem
quite lucid and accessible. After reading and rereading (I've looked at
every page, and most several times), it appears that the "start" page is
"Cucumber Backgrounder". The problem is that this assumes you are
working with Rails, about which I know little and desire to know less. I
get stuck, on that page, at the phrase...

==When you run "script/generate cucumber" ==

Huh? Is this something you do in Rails?

Then there's this --

-----

Running script/generate cucumber adds this layout to the existing
structure:

||-- features
|   |-- step_definitions
|   |   `-- webrat_steps.rb
|   `-- support
|       `-- env.rb
|

We are now ready to begin testing with cucumber.

-----

Well, maybe for some people...but not for me.

I simply cannot see what to do first. Do I manually create some kind of
directory structure and fill it with...well, with what? Feature
description files? And then what do I do? I'm guessing that this is
covered by the "Running features" page. Am I right?

Is there documentation somewhere that talks about using cucumber to
launch BDD using a non-Rails Ruby program? I think that's what I really
need. I cannot quite get past this stuck place, so any help at all would
be much appreciated. I'm sorry to bother folks with this - I'm sure it's
all quite obvious to you; I wish it were to me, and hope that it soon
will be.

Hopefully,

Tom

--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tom Cloyd, MS MA, LMHC - Private practice Psychotherapist
Bellingham, Washington, U.S.A: (360) 920-1226
<< tc@tomcloyd.com >> (email)
<< TomCloyd.com >> (website)
<< sleightmind.wordpress.com >> (mental health weblog)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0be0e4aa42aacd9a8a95c792de273ca7?d=identicon&s=25 Aslak Hellesøy (aslakhellesoy)
on 2009-01-11 14:49
(Received via mailing list)
On Sun, Jan 11, 2009 at 1:26 PM, Tom Cloyd <tomcloyd@comcast.net> wrote:

> So here I am trying to started using cucumber, and I'm having a little
> Huh? Is this something you do in Rails?
>

Yes, this is Rails only.

I recommend you take a look at the examples/i18n folder. You'll find
some
really simplistic Cucumber code that is simple Ruby. No Rails or other
complex material.

Aslak
171ea139761951336b844e708d1547ab?d=identicon&s=25 James Byrne (byrnejb)
on 2009-01-12 16:20
Tom Cloyd wrote:
>
> The problem is that this assumes you are working with Rails, about
> which I know little and desire to know less. I get stuck, on that page,
> at the phrase...
>
> ==When you run "script/generate cucumber" ==
>
> Huh? Is this something you do in Rails?
>
> Then there's this --
>
> -----
>
> Running script/generate cucumber adds this layout to the existing
> structure:
>
> ||-- features
> |   |-- step_definitions
> |   |   `-- webrat_steps.rb
> |   `-- support
> |       `-- env.rb
> |
>
> We are now ready to begin testing with cucumber.
>
> -----
>
> Well, maybe for some people...but not for me.
>
> I simply cannot see what to do first.

First, let me a assure you that ignorance, or at least the admission to
it, is a de facto requirement here.  If we all knew everything then
there would be precious little to write about.

Second, as the author of the Cucumber Backgrounder, I apologize for my
evident bias in creating a solely Rails Centric guide.  This article
was, in fact, my first attempt at such a thing and I completely
overlooked that others might not approach testing with cucumber from
outside the Rails Framework.  Over the next little while I will
endeavour to correct that defect.

Third, that article was intended as a guide on how to get cucumber
working inside a Rails project rather than a guide on how to actually
construct tests/features.  In other words, it deals primarily with the
mechanics of setting up the environment rather than with exercising the
capabilities.
D15a45a973443d4562051eb675b60474?d=identicon&s=25 Tom Cloyd (Guest)
on 2009-01-14 16:24
(Received via mailing list)
James Byrne wrote:
>> Then there's this --
>> |       `-- env.rb
>
> First, let me a assure you that ignorance, or at least the admission to
> it, is a de facto requirement here.  If we all knew everything then
> there would be precious little to write about.
>
Nicely put! Thanks for the reassurance. I remain assured, however, that
I'll assuredly be the class dummy here, which is to say that I will
quite effortlessly make all others look very good (!).
> Second, as the author of the Cucumber Backgrounder, I apologize for my
> evident bias in creating a solely Rails Centric guide.  This article
> was, in fact, my first attempt at such a thing and I completely
> overlooked that others might not approach testing with cucumber from
> outside the Rails Framework.  Over the next little while I will
> endeavour to correct that defect.
>
Very kind of you.
> Third, that article was intended as a guide on how to get cucumber
> working inside a Rails project rather than a guide on how to actually
> construct tests/features.  In other words, it deals primarily with the
> mechanics of setting up the environment rather than with exercising the
> capabilities.
>
Distinction noted.

All me to say that I found, and continue to find, your article a primary
source of real value to me, far more useful to me than not, as I
commence my cucumber adventure, later today. Thanks for your effort, and
for any further efforts you make in a similar direction.

Tom

--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tom Cloyd, MS MA, LMHC - Private practice Psychotherapist
Bellingham, Washington, U.S.A: (360) 920-1226
<< tc@tomcloyd.com >> (email)
<< TomCloyd.com >> (website)
<< sleightmind.wordpress.com >> (mental health weblog)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D15a45a973443d4562051eb675b60474?d=identicon&s=25 Tom Cloyd (Guest)
on 2009-01-14 16:39
(Received via mailing list)
aslak hellesoy wrote:
>     I have a small project I'm working on - setting up a database
>     every page, and most several times), it appears that the "start"
> Yes, this is Rails only.
>
> I recommend you take a look at the examples/i18n folder. You'll find
> some really simplistic Cucumber code that is simple Ruby. No Rails or
> other complex material.
>
> Aslak
Thanks - yes that's the complete picture I needed. I'm launched.
Fantastic!

t.

--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tom Cloyd, MS MA, LMHC - Private practice Psychotherapist
Bellingham, Washington, U.S.A: (360) 920-1226
<< tc@tomcloyd.com >> (email)
<< TomCloyd.com >> (website)
<< sleightmind.wordpress.com >> (mental health weblog)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This topic is locked and can not be replied to.