I am trying to use RSpec to test a library that uses Capybara to read data from websites.
I want to use PuffingBilly to record the interactions within this library, but I cannot get PuffingBilly to respond at all, because I think it is focused on the instance of Capybara that RSpec is using.
How do I get PuffingBilly to interdict requests from this other Capybara::Session?
Backtrace
6: from /home/jessethebuilder/.rvm/gems/ruby-2.5.3/gems/puffing-billy-2.1.1/lib/billy/proxy.rb:19:in block in start' 5: from /home/jessethebuilder/.rvm/gems/ruby-2.5.3/gems/puffing-billy-2.1.1/lib/billy/proxy.rb:70:inmain_loop' 4: from /home/jessethebuilder/.rvm/gems/ruby-2.5.3/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in run' 3: from /home/jessethebuilder/.rvm/gems/ruby-2.5.3/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:inrun_machine' 2: from /home/jessethebuilder/.rvm/gems/ruby-2.5.3/gems/puffing-billy-2.1.1/lib/billy/proxy.rb:76:in block in main_loop' 1: from /home/jessethebuilder/.rvm/gems/ruby-2.5.3/gems/eventmachine-1.2.7/lib/eventmachine.rb:531:instart_server' /home/jessethebuilder/.rvm/gems/ruby-2.5.3/gems/eventmachine-1.2.7/lib/eventmachine.rb:531:in `start_tcp_server': no acceptor (port is in use or requires root privileges) (RuntimeError)
Config (spec/spec_helper.rb)
Billy.configure do |c|
c.cache = true
c.cache_request_headers = false
c.ignore_params = []
c.path_blacklist = []
c.merge_cached_responses_whitelist = []
c.persist_cache = true
c.ignore_cache_port = true # defaults to true
c.non_successful_cache_disabled = false
c.non_successful_error_level = :warn
c.non_whitelisted_requests_disabled = false
c.cache_path = 'spec/fixtures/billy/req_cache/'
c.certs_path = 'spec/fixtures/billy/req_certs/'
c.proxy_host = 'localhost'
c.proxy_port = 4461
# c.proxied_request_host = 'localhost'
# c.proxied_request_port = 4461
c.record_requests = true
c.cache_request_body_methods = ['post', 'patch', 'put', 'get']
end