summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTails developers <amnesia@boum.org>2015-02-18 15:25:28 +0100
committerTails developers <amnesia@boum.org>2015-02-18 15:25:28 +0100
commit3f94cc95c091fb594e75cd151e29715c0ee92198 (patch)
tree3f651babce927d3c7a9ca2dfd807723a42b4d067
parent9cd7917bbba86cd391d49c9d8ba2784f3587f3f7 (diff)
Fix error messages if port/@conn_port is nil.
-rw-r--r--features/step_definitions/tor.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/features/step_definitions/tor.rb b/features/step_definitions/tor.rb
index 474e7d3..f6de076 100644
--- a/features/step_definitions/tor.rb
+++ b/features/step_definitions/tor.rb
@@ -171,8 +171,9 @@ end
When /^I open an untorified (TCP|UDP|ICMP) connections to (\S*)(?: on port (\d+))? that is expected to fail$/ do |proto, host, port|
next if @skip_steps_while_restoring_background
assert(!firewall_has_dropped_packet_to?(proto, host, port),
- "A #{proto} packet to #{host}:#{port} has already been dropped by " \
- "the firewall")
+ "A #{proto} packet to #{host}" +
+ (port.nil? ? "" : ":#{port}") +
+ " has already been dropped by the firewall")
@conn_proto = proto
@conn_host = host
@conn_port = port
@@ -207,8 +208,9 @@ end
Then /^the untorified connection is logged as dropped by the firewall$/ do
next if @skip_steps_while_restoring_background
assert(firewall_has_dropped_packet_to?(@conn_proto, @conn_host, @conn_port),
- "No #{@conn_proto} packet to #{@conn_host}:#{@conn_port} was " \
- "dropped by the firewall")
+ "No #{@conn_proto} packet to #{@conn_host}" +
+ (@conn_port.nil? ? "" : ":#{@conn_port}") +
+ " was dropped by the firewall")
end
When /^the system DNS is(?: still)? using the local DNS resolver$/ do