I''ve been looking at the authentication feature example contained in merb_cucumber and not having used features with tabulated input before I had to go and look for an explanation of the syntax. However when I looked at the wiki page on github that deals with this - http://wiki.github.com/aslakhellesoy/cucumber/using-fit-tables-in-a-feature I had some difficulty mapping the description there into what I was seeing in the example, which is shown here - http://github.com/david/merb_cucumber/tree/master/lib/generators/cucumber/templates/features/authentication/login.feature After some searching I found a discussion on lighthouse that seems to bear on this issue - http://rspec.lighthouseapp.com/projects/16211-cucumber/tickets/57-scenario-templates-to-allow-for-terse-scenario-tables This describes a syntax change that (if I understand correctly) involves putting variable placeholders in angle brackets and matching these to the column headings in the table. This seems to be consistent with the merb-cucumber example. However if I''m understanding this correctly, it looks like the change has not yet been reflected in the github documentation. Can someone confirm for me that this is the case, because it''s possible that I''m just plain confused. Also, does the approach currently shown in the documentation still work? And is the idea there that table columns map sequentially onto the strings that correspond to the regexp match groups in the step definitions? Are the column headings then essentially redundant in that case? Mark.
On 10 Jan 2009, at 23:44, MarkMT wrote:> I''ve been looking at the authentication feature example contained in > merb_cucumber and not having used features with tabulated input before > I had to go and look for an explanation of the syntax. However when I > looked at the wiki page on github that deals with this - > > http://wiki.github.com/aslakhellesoy/cucumber/using-fit-tables-in-a-feature > > I had some difficulty mapping the description there into what I was > seeing in the example, which is shown here - > > http://github.com/david/merb_cucumber/tree/master/lib/generators/cucumber/templates/features/authentication/login.feature > > After some searching I found a discussion on lighthouse that seems to > bear on this issue - > > http://rspec.lighthouseapp.com/projects/16211-cucumber/tickets/57-scenario-templates-to-allow-for-terse-scenario-tables > > This describes a syntax change that (if I understand correctly) > involves putting variable placeholders in angle brackets and matching > these to the column headings in the table. This seems to be consistent > with the merb-cucumber example. > > However if I''m understanding this correctly, it looks like the change > has not yet been reflected in the github documentation. Can someone > confirm for me that this is the case, because it''s possible that I''m > just plain confused. > > Also, does the approach currently shown in the documentation still > work? And is the idea there that table columns map sequentially onto > the strings that correspond to the regexp match groups in the step > definitions? Are the column headings then essentially redundant in > that case? > > Mark.Hi Mark, I can''t check the github wiki right now, because GH is down, but I''m sure I saw Scenario Outline documented on there today. There are three ways of doing tabulated data in Cucumber, and as far as I know they''re all still supported. The basic way, shown on the homepage for cucumber, works in Given and Then steps (but not When), and looks like Then there should be the following people: | name | age | | Matt | 33 | | Anna | 31 | The next way extends a single Scenario with a More Examples table. The third, and newest way uses a Scenario Outline to define a template, followed by an Examples table to define the value substitutions to make the scenario actually run. HTH, Matt Wynne http://blog.mattwynne.net http://www.songkick.com
Thanks Matt. I have now found the page that deals with scenario outlines (GH is back up) - http://wiki.github.com/aslakhellesoy/cucumber/scenario-outlines so that is now pretty clear. Might be worth a note in the fit table page referring to that. On Jan 10, 6:08?pm, Matt Wynne <m... at mattwynne.net> wrote:> On 10 Jan 2009, at 23:44, MarkMT wrote: > > > > > I''ve been looking at the authentication feature example contained in > > merb_cucumber and not having used features with tabulated input before > > I had to go and look for an explanation of the syntax. However when I > > looked at the wiki page on github that deals with this - > > >http://wiki.github.com/aslakhellesoy/cucumber/using-fit-tables-in-a-f... > > > I had some difficulty mapping the description there into what I was > > seeing in the example, which is shown here - > > >http://github.com/david/merb_cucumber/tree/master/lib/generators/cucu... > > > After some searching I found a discussion on lighthouse that seems to > > bear on this issue - > > >http://rspec.lighthouseapp.com/projects/16211-cucumber/tickets/57-sce... > > > This describes a syntax change that (if I understand correctly) > > involves putting variable placeholders in angle brackets and matching > > these to the column headings in the table. This seems to be consistent > > with the merb-cucumber example. > > > However if I''m understanding this correctly, it looks like the change > > has not yet been reflected in the github documentation. Can someone > > confirm for me that this is the case, because it''s possible that I''m > > just plain confused. > > > Also, does the approach currently shown in the documentation still > > work? And is the idea there that table columns map sequentially onto > > the strings that correspond to the regexp match groups in the step > > definitions? Are the column headings then essentially redundant in > > that case? > > > Mark. > > Hi Mark, > > I can''t check the github wiki right now, because GH is down, but I''m ? > sure I saw Scenario Outline documented on there today. > > There are three ways of doing tabulated data in Cucumber, and as far ? > as I know they''re all still supported. > > The basic way, shown on the homepage for cucumber, works in Given and ? > Then steps (but not When), and looks like > > ? ? ?Then there should be the following people: > ? ? ? ?| name ?| age | > ? ? ? ?| Matt ?| 33 ?| > ? ? ? ?| Anna ?| 31 ?| > > The next way extends a single Scenario with a More Examples table. > > The third, and newest way uses a Scenario Outline to define a ? > template, followed by an Examples table to define the value ? > substitutions to make the scenario actually run. > > HTH, > > Matt Wynnehttp://blog.mattwynne.nethttp://www.songkick.com > > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
On 11 Jan 2009, at 01:22, MarkMT wrote:> Thanks Matt. I have now found the page that deals with scenario > outlines (GH is back up) - > > http://wiki.github.com/aslakhellesoy/cucumber/scenario-outlines > > so that is now pretty clear. Might be worth a note in the fit table > page referring to that.The wiki is open to all... be our guest! Seriously it''s terrific if first-timers can polish these pages, as they''re often written by those of us who are quite immersed in the product and consequently find it harder to put on the ''newbie hat'' to proof-read documentation. cheers, Matt Wynne http://blog.mattwynne.net http://www.songkick.com