You should always have `if/else` and never end with an `elsif`. You run the case of allowing a path to execute you did not intend for. I would rewrite this as:

```ruby
if Regexp === options[:src] && image = find_image_with_regex(options[:src])
  locator.concat"[@src='#{image}']")
elsif options[:src]
  locator.concat "[@src='#{options[:src]}']"
else
  return false
end
```