diff options
author | Azul <azul@riseup.net> | 2017-09-23 11:07:32 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2017-09-23 16:53:27 +0200 |
commit | 40916407517f4bdb75a295caf29e02d4f403349b (patch) | |
tree | 8219567c0ecdf583fdd916594ec7915ab9eb2f19 /test/functional | |
parent | 22c6c80310a8d3d3abbd1006598b4fbaec98ffd0 (diff) |
style: rubocop mostly auto-correct
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/bin_test.rb | 20 | ||||
-rw-r--r-- | test/functional/sample_test.rb | 8 |
2 files changed, 13 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..dbd8796 100644 --- a/test/functional/sample_test.rb +++ b/test/functional/sample_test.rb @@ -49,7 +49,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 +57,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 |