summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkytv <killyourtv@i2pmail.org>2015-07-08 18:37:57 +0000
committerkytv <killyourtv@i2pmail.org>2015-07-09 02:03:36 +0000
commitee960ba1996eaf585990f34c6d01b412828bb06d (patch)
tree835c43b498c6ca941b2e3e9265171313261d16ac
parentd202dddd631d3f0ef6397251dd255d633435e8be (diff)
Create new function, force_new_tor_circuit
This is being called more often than I initially assumed it would be.
-rw-r--r--features/step_definitions/common_steps.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/features/step_definitions/common_steps.rb b/features/step_definitions/common_steps.rb
index ecaf49a..bb8f913 100644
--- a/features/step_definitions/common_steps.rb
+++ b/features/step_definitions/common_steps.rb
@@ -1060,6 +1060,14 @@ When /^I open a page on the LAN web server in the (.*)$/ do |browser|
step "I open the address \"#{@web_server_url}\" in the #{browser}"
end
+def force_new_tor_circuit
+ assert(!@new_circuit_tries.nil? && @new_circuit_tries >= 0,
+ '@new_circuit_tries was not initialized before it was used')
+ @new_circuit_tries += 1
+ STDERR.puts "Forcing new Tor circuit... (attempt ##{@new_circuit_tries})" if $config["DEBUG"]
+ step 'I force Tor to use a new circuit'
+end
+
Then /^I force Tor to use a new circuit( in Vidalia)?$/ do |with_vidalia|
if with_vidalia
assert_equal('gnome', @theme, "Vidalia is not available in the #{@theme} theme.")