Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebMock.disable_net_connect! Overwrite #805

Open
eric-zhu-uw opened this issue Feb 8, 2019 · 0 comments
Open

WebMock.disable_net_connect! Overwrite #805

eric-zhu-uw opened this issue Feb 8, 2019 · 0 comments

Comments

@eric-zhu-uw
Copy link

eric-zhu-uw commented Feb 8, 2019

Currently the behavior for WebMock is for every call to WebMock.disable_net_connect!(options = {}) it will overwrite all previous configurations.

 def self.disable_net_connect!(options = {})
    Config.instance.allow_net_connect = false
    Config.instance.allow_localhost = options[:allow_localhost]
    Config.instance.allow = options[:allow]
    Config.instance.net_http_connect_on_start = options[:net_http_connect_on_start]
  end

This is annoying since it forces the user to reconfigure and redeclare all pre-existing allowed urls every time a change needs to be made.

It would be better if you had the option to append and remove instead of overwrite.

This ideology can be applied to a bunch of configuration settings however this is the one I used in particular so I am using it as an example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant