Articles tagged with 'testing'
I like frameworks, but sometimes debugging them is more entertaining. I don’t know why I didn’t think of this method before, but mischa on github has a great little repo showing how you can do it.
The README
Usage:
Add:
require ‘ruby-debug’
require ‘cucumber_rails_debug/steps’
To features/support/env.rb
Then use:
Then debug # opens the debugger
or
Then what #prints out params, url and html
Check it ...
Selenium is a suite of tools to automate web app testing across many platforms. Cucumber is a BDD framework that allows you to write things in English (or whatever language you want, really), and have that execute as code. Put those together with webrat and rspec and you have a pretty mean stack to test your ruby on rails web application with. Sort of.
I’ve been having some problems with it, getting it set up, but it’s coming along...
In case you just crawled out from under your rock just to read my blog, and haven’t the foggiest, cucumber is a ruby acceptance testing framework, and works great with rails.
I was writing features for admin users in this application, and needed a step like this:
Then I should be editing "test@example.com"
Where the quoted email is the login. Later on (in fact right after…I was testing edit functionality, and after safe you end up ...
I keep coming back to asking myself what the difference between stub and mock objects are and I have it figured out, so here it is:
Stubs just return whatever you tell them do, and that’s it. Mocks have expectations and cause tests to fail if those expectations aren’t met.