S Ahmed
2011-May-09 14:00 UTC
[rspec-users] Cucumber and rspec, do cucumber step definitions use rspec?
I''m a bit confused as to how cucumber and rspec integrate (if they d at all?). You write a cucumber feature, and step definitions. Now in the step definitions, do you write rspec in the step definitions or do they somehow link to the spec''s written elsewhere? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110509/1687e48d/attachment-0001.html>
Andrew Premdas
2011-May-09 14:48 UTC
[rspec-users] Cucumber and rspec, do cucumber step definitions use rspec?
On 9 May 2011 15:00, S Ahmed <sahmed1020 at gmail.com> wrote:> I''m a bit confused as to how cucumber and rspec integrate (if they d at > all?). > > You write a cucumber feature, and step definitions. > Now in the step definitions, do you write rspec in the step definitions or > do they somehow link to the spec''s written elsewhere? > > > > Cucumber and rspec are different tools. Cucumber is aimed at a higher level(functional) whilst rspec is aimed at the unit level. So Cucumber features specify your applications behaviour, whilst rspec specifies your objects (and/or classes) behaviour. The best place to see how they work in tandem is the RSpec Book. All best Andrew _______________________________________________> rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-- ------------------------ Andrew Premdas blog.andrew.premdas.org -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110509/79313e0d/attachment.html>
S Ahmed
2011-May-09 15:12 UTC
[rspec-users] Cucumber and rspec, do cucumber step definitions use rspec?
Andrew, I''ve actually read allot of the book (but admittedly I brushed over the cucumber sections), but I was confused at this point. I understand the outside in development, etc. What I was confused at was if the two technologies actually integrate at some point. i.e. if you run cucumber, will it go and run spec''s for you also? Correct me if I am wrong, but the cucumber step definitions do indeed use webrat to hit the pages and verify things in the view pages correct? On Mon, May 9, 2011 at 10:48 AM, Andrew Premdas <apremdas at gmail.com> wrote:> > > On 9 May 2011 15:00, S Ahmed <sahmed1020 at gmail.com> wrote: > >> I''m a bit confused as to how cucumber and rspec integrate (if they d at >> all?). >> >> You write a cucumber feature, and step definitions. >> Now in the step definitions, do you write rspec in the step definitions or >> do they somehow link to the spec''s written elsewhere? >> >> >> >> Cucumber and rspec are different tools. Cucumber is aimed at a higher > level (functional) whilst rspec is aimed at the unit level. So Cucumber > features specify your applications behaviour, whilst rspec specifies your > objects (and/or classes) behaviour. > > The best place to see how they work in tandem is the RSpec Book. > > All best > > Andrew > > > _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >> > > > > -- > ------------------------ > Andrew Premdas > blog.andrew.premdas.org > > > _______________________________________________ > 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/20110509/95d83715/attachment.html>
Matt Wynne
2011-May-10 16:06 UTC
[rspec-users] Cucumber and rspec, do cucumber step definitions use rspec?
On 9 May 2011, at 16:00, S Ahmed wrote:> I''m a bit confused as to how cucumber and rspec integrate (if they d at all?). > > You write a cucumber feature, and step definitions. > Now in the step definitions, do you write rspec in the step definitions or do they somehow link to the spec''s written elsewhere?You write *Ruby* code in the step definitions. Because Cucumber is a testing tool, you often want to make assertions in that Ruby code about how the system you''re testing is behaving. RSpec gives you assertions, so you can use RSpec''s assertions in your step definitions. You can also use Ruby''s own built-in assertions from the Test::Unit::Assertions namespace. cheers, Matt -- Freelance programmer & coach Founder, http://relishapp.com +44(0)7974430184 | http://twitter.com/mattwynne
aslak hellesoy
2011-May-10 16:50 UTC
[rspec-users] Cucumber and rspec, do cucumber step definitions use rspec?
On Mon, May 9, 2011 at 3:00 PM, S Ahmed <sahmed1020 at gmail.com> wrote:> I''m a bit confused as to how cucumber and rspec integrate (if they d at > all?). > >RSpec is two things: a) A runner (command line program) b) An assertion library (should, should_not, be_nil and friens) Cucumber doesn''t use a) at all. If you want, you can use b) in your step definitions. If you don''t, Cucumber won''t use RSpec at all. HTH, Aslak You write a cucumber feature, and step definitions.> Now in the step definitions, do you write rspec in the step definitions or > do they somehow link to the spec''s written elsewhere? > > > > _______________________________________________ > 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/20110510/0f4cfd4d/attachment.html>
David Chelimsky
2011-May-10 17:44 UTC
[rspec-users] Cucumber and rspec, do cucumber step definitions use rspec?
On May 10, 2011, at 11:50 AM, aslak hellesoy wrote:> > > On Mon, May 9, 2011 at 3:00 PM, S Ahmed <sahmed1020 at gmail.com> wrote: > I''m a bit confused as to how cucumber and rspec integrate (if they d at all?). > > > RSpec is two things: > a) A runner (command line program) > b) An assertion library (should, should_not, be_nil and friends)c) mocking/stubbing> > Cucumber doesn''t use a) at all. > If you want, you can use b) in your step definitions. If you don''t, Cucumber won''t use RSpec at all.Same for stubs. Cheers, David -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110510/e8c1f8e2/attachment-0001.html>
aslak hellesoy
2011-May-10 18:18 UTC
[rspec-users] Cucumber and rspec, do cucumber step definitions use rspec?
On Mon, May 9, 2011 at 4:12 PM, S Ahmed <sahmed1020 at gmail.com> wrote:> Andrew, I''ve actually read allot of the book (but admittedly I brushed over > the cucumber sections), but I was confused at this point. > > I understand the outside in development, etc. > > What I was confused at was if the two technologies actually integrate at > some point. > > i.e. if you run cucumber, will it go and run spec''s for you also? > >Nope> Correct me if I am wrong, but the cucumber step definitions do indeed use > webrat to hit the pages and verify things in the view pages correct? > >Cucumber-Rails generates some step definitions for you in features/step_definitions/web_steps.rb that: * Use Webrat or Capybara, depending on the command line options you pass to the cucumber:install generator * We recommend you delete those stepdefs and write your own, based on the Capybara API. * Cucumber-Rails 0.5.0 will not support Webrat at all, only Capybara Aslak> On Mon, May 9, 2011 at 10:48 AM, Andrew Premdas <apremdas at gmail.com>wrote: > >> >> >> On 9 May 2011 15:00, S Ahmed <sahmed1020 at gmail.com> wrote: >> >>> I''m a bit confused as to how cucumber and rspec integrate (if they d at >>> all?). >>> >>> You write a cucumber feature, and step definitions. >>> Now in the step definitions, do you write rspec in the step definitions >>> or do they somehow link to the spec''s written elsewhere? >>> >>> >>> >>> Cucumber and rspec are different tools. Cucumber is aimed at a higher >> level (functional) whilst rspec is aimed at the unit level. So Cucumber >> features specify your applications behaviour, whilst rspec specifies your >> objects (and/or classes) behaviour. >> >> The best place to see how they work in tandem is the RSpec Book. >> >> All best >> >> Andrew >> >> >> _______________________________________________ >>> rspec-users mailing list >>> rspec-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/rspec-users >>> >> >> >> >> -- >> ------------------------ >> Andrew Premdas >> blog.andrew.premdas.org >> >> >> _______________________________________________ >> 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/20110510/7d29d9da/attachment.html>