Tag Archives: Regular Expressions

Updated script to list all cucumber step definitions

In a previous post I put up a small script that would dump out all step definitions available in a cucumber project. Here’s an updated version… it hasn’t changed much apart from the output is now a html table that … Continue reading

Posted in Automated Testing, Example Code, Making Life Easier, Ruby, Tools, cucumber | Tagged , , , , , | Leave a comment

Ruby regex code examples summary

Coming from java, ruby’s regex implementation seems a bit obtuse. Here’s a bunch of code examples which I’ve put together as a mini-reference for my own use. If I’ve missed anything major, leave a comment. And sorry about the code … Continue reading

Posted in Example Code, Ruby | Tagged , | Leave a comment

How to know if you have a secure session in Watir

Sometimes you’re on a secure page, sometimes you’re not. How to know? There’s a very simple method you can write to find out, based on the browser’s current url. Here’s the method: def is_session_secure? @browser.url =~ /^https/ ? true : … Continue reading

Posted in Example Code, Ruby, Test::Unit, WATIR | Tagged , , , , , , | Leave a comment

How to add 2 ruby regex patterns together

Here’s a monkeypatch for ruby’s Regexp class that will allow you to concatenate 2 (or more) regex patterns together: class Regexp def +(r) Regexp.new(source + r.source) end end It comes in very useful when doing something like the following… protocol_rgx … Continue reading

Posted in Example Code, Ruby | Tagged , , | Leave a comment

Regular Expressions Pocket Reference

I’ve not had this book for long, but if you spend a lot of time with regular expressions (specifically with Rational Functional Tester’s object recognition properties) you’ll find it very useful. I know I have… O’Reilly, prepare for some free … Continue reading

Posted in Automated Testing, Books, Rational Functional Tester | Tagged , | Leave a comment