Thanks for all the advise and corrections. I ended up with this: When /\bsee a (?:log|sign)(?: ?)[io]n success message/ do # login | log in | logon | log on | signin ... Then "see the login ok message" end
As to the issue of whether this is being too clever by half: Perhaps. I have to consider though, that various people are going to be working on features relating to this project under a wide range of circumstances and that features will develop over a long period of time. While it might appear attractive to simply insist that a session is always a login the fact is that language is not so precise; login, logon, log in, log on, signin, signon, sign in and sign on are all common synonyms for the same action. Internally, the action is just login. Logins are a pervasive feature of this application and so, rather than waste effort on policing the feature syntax, I thought it best just to accommodate the likely variations from the start. Admittedly, I also availed myself of this opportunity to gain additional knowledge regarding regexp and so this example is perhaps overwrought for the actual purpose at hand. Finally, thank you Ben very much for the reference to http://www.rubular.com -- Posted via http://www.ruby-forum.com/. _______________________________________________ rspec-users mailing list [email protected] http://rubyforge.org/mailman/listinfo/rspec-users
