Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Cucumber With and Without Rails

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Matt/Aslak:

As I understand it, there are a few gems that make using Cucumber with Rails trivial. But what about situations in which Rails isn't used? Further, I'm especially interested in testing Rails and non-rails RESTful web services and heavily AJAX dependant UIs. Can you elaborate on how Cucumber can help in this regard?
 
author
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Dan,

Cucumber is really just the glue that binds your business-readable specifications to the code in the step definitions that run those specifications. What you put in those step definitions is up to you, and depends on the kind of app you're testing. Cucumber grew up in and around the Rails community, but it's widely used outside of Rails.

We tried to keep the book largely Rails-free. The main worked example doesn't use Rails at all. We've also got a chapter on testing REST APIs (which could be in any language) using the HttParty ruby library to automate the REST API via HTTP, which I think you'd find useful. The best Ruby library for automating web apps is Capybara, and although the chapter on Capybara does use a Rails app as the example, we clearly show how to use it for other kinds of web servers too.

Does that help?
 
Maybe he went home and went to bed. And took this tiny ad with him:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic