Skip to content

Commit

Permalink
rspec: Replace pending with skip
Browse files Browse the repository at this point in the history
For our cases we should use later one as of RSpec 3.

Signed-off-by: Takuro Ashie <ashie@clear-code.com>
  • Loading branch information
ashie committed Mar 14, 2023
1 parent cd6c0d3 commit 71e6197
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions spec/daemon_logger_spec.rb
Expand Up @@ -150,7 +150,7 @@
end

it 'inter-process locking on rotation' do
pending "fork is not implemented in Windows" if ServerEngine.windows?
skip "fork is not implemented in Windows" if ServerEngine.windows?

log = DaemonLogger.new("tmp/se4.log", level: 'trace', log_rotate_age: 3, log_rotate_size: 10)
r, w = IO.pipe
Expand All @@ -175,7 +175,7 @@
end

it 'reopen log when path is renamed' do
pending "rename isn't supported on windows" if ServerEngine.windows?
skip "rename isn't supported on windows" if ServerEngine.windows?

log = DaemonLogger.new("tmp/rotate.log", { level: 'info', log_rotate_age: 0 })

Expand Down
10 changes: 5 additions & 5 deletions spec/daemon_spec.rb
Expand Up @@ -11,7 +11,7 @@
end

it 'run and graceful stop by signal' do
pending "not supported signal base commands on Windows" if ServerEngine.windows?
skip "not supported signal base commands on Windows" if ServerEngine.windows?

dm = Daemon.new(TestServer, TestWorker, daemonize: true, pid_path: "tmp/pid", command_sender: "signal")
dm.main
Expand All @@ -33,7 +33,7 @@
end

it 'signals' do
pending "not supported signal base commands on Windows" if ServerEngine.windows?
skip "not supported signal base commands on Windows" if ServerEngine.windows?
dm = Daemon.new(TestServer, TestWorker, daemonize: true, pid_path: "tmp/pid", command_sender: "signal")
dm.main

Expand Down Expand Up @@ -112,7 +112,7 @@
end

it 'exits with status 0 when it was stopped normally' do
pending "worker type process(fork) cannot be used in Windows" if ServerEngine.windows?
skip "worker type process(fork) cannot be used in Windows" if ServerEngine.windows?
dm = Daemon.new(
TestServer,
TestWorker,
Expand All @@ -135,7 +135,7 @@
end

it 'exits with status of workers if worker exits with status specified in unrecoverable_exit_codes, without supervisor' do
pending "worker type process(fork) cannot be used in Windows" if ServerEngine.windows?
skip "worker type process(fork) cannot be used in Windows" if ServerEngine.windows?

dm = Daemon.new(
TestServer,
Expand All @@ -159,7 +159,7 @@
end

it 'exits with status of workers if worker exits with status specified in unrecoverable_exit_codes, with supervisor' do
pending "worker type process(fork) cannot be used in Windows" if ServerEngine.windows?
skip "worker type process(fork) cannot be used in Windows" if ServerEngine.windows?

dm = Daemon.new(
TestServer,
Expand Down
14 changes: 7 additions & 7 deletions spec/multi_process_server_spec.rb
Expand Up @@ -17,7 +17,7 @@
end

it 'scale up' do
pending "Windows environment does not support fork" if ServerEngine.windows? && impl_class == ServerEngine::MultiProcessServer
skip "Windows environment does not support fork" if ServerEngine.windows? && impl_class == ServerEngine::MultiProcessServer

config = {
workers: 2,
Expand Down Expand Up @@ -50,7 +50,7 @@
end

it 'scale down' do
pending "Windows environment does not support fork" if ServerEngine.windows? && impl_class == ServerEngine::MultiProcessServer
skip "Windows environment does not support fork" if ServerEngine.windows? && impl_class == ServerEngine::MultiProcessServer

config = {
workers: 2,
Expand Down Expand Up @@ -98,7 +98,7 @@
end

it 'raises SystemExit when all workers exit with specified code by unrecoverable_exit_codes' do
pending "Windows environment does not support fork" if ServerEngine.windows? && impl_class == ServerEngine::MultiProcessServer
skip "Windows environment does not support fork" if ServerEngine.windows? && impl_class == ServerEngine::MultiProcessServer

config = {
workers: 4,
Expand Down Expand Up @@ -127,7 +127,7 @@
end

it 'raises SystemExit immediately when a worker exits if stop_immediately_at_unrecoverable_exit specified' do
pending "Windows environment does not support fork" if ServerEngine.windows? && impl_class == ServerEngine::MultiProcessServer
skip "Windows environment does not support fork" if ServerEngine.windows? && impl_class == ServerEngine::MultiProcessServer

config = {
workers: 4,
Expand Down Expand Up @@ -172,7 +172,7 @@
end

it 'stop' do
pending "Windows environment does not support fork" if ServerEngine.windows?
skip "Windows environment does not support fork" if ServerEngine.windows?

config = {
workers: 1,
Expand All @@ -197,7 +197,7 @@
end

it 'non zero exit status' do
pending "Windows environment does not support fork" if ServerEngine.windows?
skip "Windows environment does not support fork" if ServerEngine.windows?

config = {
workers: 1,
Expand Down Expand Up @@ -232,7 +232,7 @@ def initialize
end

it 'zero exit status' do
pending "Windows environment does not support fork" if ServerEngine.windows?
skip "Windows environment does not support fork" if ServerEngine.windows?

config = {
workers: 1,
Expand Down
12 changes: 6 additions & 6 deletions spec/supervisor_spec.rb
Expand Up @@ -90,7 +90,7 @@ def start_daemon(**config)
context "when using #{sender} as command_sender" do

it 'start and graceful stop' do
pending 'not supported on Windows' if ServerEngine.windows? && sender == 'signal'
skip 'not supported on Windows' if ServerEngine.windows? && sender == 'signal'

sv, t = start_supervisor(command_sender: sender)

Expand All @@ -113,7 +113,7 @@ def start_daemon(**config)
end

it 'immediate stop' do
pending 'not supported on Windows' if ServerEngine.windows? && sender == 'signal'
skip 'not supported on Windows' if ServerEngine.windows? && sender == 'signal'

sv, t = start_supervisor(command_sender: sender)

Expand All @@ -131,7 +131,7 @@ def start_daemon(**config)
end

it 'graceful restart' do
pending 'not supported on Windows' if ServerEngine.windows? && sender == 'signal'
skip 'not supported on Windows' if ServerEngine.windows? && sender == 'signal'

sv, t = start_supervisor(command_sender: sender)

Expand All @@ -155,7 +155,7 @@ def start_daemon(**config)
end

it 'immediate restart' do
pending 'not supported on Windows' if ServerEngine.windows? && sender == 'signal'
skip 'not supported on Windows' if ServerEngine.windows? && sender == 'signal'

sv, t = start_supervisor(command_sender: sender)

Expand All @@ -179,7 +179,7 @@ def start_daemon(**config)
end

it 'reload' do
pending 'not supported on Windows' if ServerEngine.windows? && sender == 'signal'
skip 'not supported on Windows' if ServerEngine.windows? && sender == 'signal'

sv, t = start_supervisor(command_sender: sender)

Expand All @@ -200,7 +200,7 @@ def start_daemon(**config)
# TODO detach

it 'auto restart in limited ratio' do
pending 'not supported on Windows' if ServerEngine.windows? && sender == 'signal'
skip 'not supported on Windows' if ServerEngine.windows? && sender == 'signal'

RR.stub(ServerEngine).dump_uncaught_error

Expand Down

0 comments on commit 71e6197

Please sign in to comment.