summaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorazul <azul@riseup.net>2017-09-23 15:11:20 +0000
committerazul <azul@riseup.net>2017-09-23 15:11:20 +0000
commitfac140a8ff76e98c275194845125d4c97f4ba07b (patch)
tree08ffafb2c70935892e975704911080b9da84e391 /test/functional
parent787287318c54b019a12ef79525c9f5b10d93724d (diff)
parent8ac6bb8492c9a3b9ec5d7b5bf2b35907a1f8c332 (diff)
Merge branch 'rubocop' into 'master'
Style fixes based on Rubocop See merge request leap/nickserver!19
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/bin_test.rb20
-rw-r--r--test/functional/sample_test.rb9
2 files changed, 14 insertions, 15 deletions
diff --git a/test/functional/bin_test.rb b/test/functional/bin_test.rb
index 3e2774c..3a4e6c7 100644
--- a/test/functional/bin_test.rb
+++ b/test/functional/bin_test.rb
@@ -2,13 +2,12 @@ require 'minitest/autorun'
require 'minitest/pride'
class BinTest < Minitest::Test
-
def teardown
- run_command "stop"
+ run_command 'stop'
end
def test_bin_loading
- assert_command_runs("version")
+ assert_command_runs('version')
end
def test_not_running_by_default
@@ -16,26 +15,26 @@ class BinTest < Minitest::Test
end
def test_start
- run_command "start"
+ run_command 'start'
assert_running
end
protected
def assert_running
- status = run_command "status"
- assert_includes status, "Nickserver running"
+ status = run_command 'status'
+ assert_includes status, 'Nickserver running'
end
def assert_stopped
- status = run_command "status"
- assert_includes status, "No nickserver processes are running."
+ status = run_command 'status'
+ assert_includes status, 'No nickserver processes are running.'
end
def assert_command_runs(command)
out = run_command command
- assert ($?.exitstatus == 0),
- "failed to run 'nickserver #{command}':\n #{out}"
+ assert ($CHILD_STATUS.exitstatus == 0),
+ "failed to run 'nickserver #{command}':\n #{out}"
end
def run_command(command)
@@ -45,5 +44,4 @@ class BinTest < Minitest::Test
def path_to_executable
File.expand_path(File.dirname(__FILE__) + '/../../bin/nickserver')
end
-
end
diff --git a/test/functional/sample_test.rb b/test/functional/sample_test.rb
index 2b49527..412555e 100644
--- a/test/functional/sample_test.rb
+++ b/test/functional/sample_test.rb
@@ -1,3 +1,4 @@
+require 'English'
require 'support/functional_test'
class SampleTest < FunctionalTest
@@ -49,7 +50,7 @@ class SampleTest < FunctionalTest
end
def lookup(address)
- run_command %Q(curl localhost:6425 #{curl_opts} -d "address=#{address}")
+ run_command %(curl localhost:6425 #{curl_opts} -d "address=#{address}")
end
def curl_opts
@@ -57,13 +58,13 @@ class SampleTest < FunctionalTest
end
def open_files_count
- run_command(%Q(lsof | grep " #{nickserver_pid} " | wc -l)).to_i
+ run_command(%(lsof | grep " #{nickserver_pid} " | wc -l)).to_i
end
def run_command(command)
`#{command} 2>&1`.tap do |out|
- assert ($?.exitstatus == 0),
- "failed to run '#{command}':\n #{out}"
+ assert ($CHILD_STATUS.exitstatus == 0),
+ "failed to run '#{command}':\n #{out}"
end
end
end