Forum: RSpec Newbie's question about generated features by cucumber in Rails

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.
505e6ea23daada2904209d7952fe6586?d=identicon&s=25 Lian Liming (Guest)
on 2008-10-04 18:54
(Received via mailing list)
Hi all,

I am new to rspec and trying to use cucumber to learn writingfeatures.
I follow the wiki page
http://github.com/aslakhellesoy/cucumber/wikis/ruby-on-rails to start
my first feature.

The command "ruby script/generate feature Frooble name color
description" generates a file "manage_froobles.feature" with
itscontent as following:

------ manage_froobles.feature ---
Feature: Manage froobles
 In order to keep track of froobles
 A frooble mechanic
 Should be able to manage several froobles

 Scenario: Register new frooble
   <....omit some lines here...>

 Scenario: Delete frooble
   Given there are 4 froobles
   When I delete the first frooble
   Then there should be 3 froobles left

   | initial | after |
   | 100    | 99    |
   | 1       | 0     |
------end of  manage_froobles.feature ---

I quite understand most of lines in this file except the last few
lines, which composes a two-column table with heads "initial" and
"after". I am really confusing on what is the meaning of those data. I
have studied some background knowledge about stories in BDD, while
those don't help me understand this. So any hints?  Thanks in dvance!

Liming
0be0e4aa42aacd9a8a95c792de273ca7?d=identicon&s=25 aslak hellesoy (Guest)
on 2008-10-04 18:58
(Received via mailing list)
On Sat, Oct 4, 2008 at 6:22 PM, Lian Liming <lianliming@gmail.com>
wrote:
>
>   Given there are 4 froobles
> "after". I am really confusing on what is the meaning of those data. I
> have studied some background knowledge about stories in BDD, while
> those don't help me understand this. So any hints?  Thanks in dvance!
>

This table will run the previous scenario once for each row in the
table, substituting the parameters in the scenario. The first line in
the table is just for documentation. It's inspired from column
fixtures in the FIT tool: http://fit.c2.com/wiki.cgi?ColumnFixture

Aslak
This topic is locked and can not be replied to.