Are you trying to change endpoint options to an array the first time around? This is likely what's causing all the failures because you're modifying the options being passed in. Try this instead, and turn the condition around:

```
endpoints << ... unless endpoint?(endpoints, endpoint_options)
```

```
def endpoint?(endpoints, options)
   options = options.dup
   options[:method] = Array(options[:method])
   options[:path] = Array(options[:path])
   endpoints.detect { |endpoint| endpoint.options == options }
end
```