Posts tagged with matcher (3)

Jun08 have_regexp custom matcher to check page content post author

rspec matcher | comments

When writing expectations on pages I like to keep them loose so they break less. I normally use the have_text matcher and I can even get looser using regexps matching but even that can break due to line breaks introduced by rendering. This is what it should be in a perfect world:

Continue reading »

Jan21 RSpec simple matcher to specify an array should be sorted post author

rspec matcher array sort | comments

RSpec is a lot about readability. And its matchers are really a joy to aid you on that. And now it is even easier to add simple matchers for (in David’s own words) you to create your own custom matchers in just a few lines of code when you don’t need all the power of a completely custom matcher object.

Continue reading »

Jul09 loading custom rspec matchers into cucumber post author

rspec cucumber matchers | comments

I happen to need to make expectations about a created user on a complex step, so when the chunk started to repeat I make myself an RSpec matcher to do that, and then load it into cucumber to be able to use it in my steps.

Continue reading »