Skip to content

Commit

Permalink
Prefer omit over skip
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Sep 7, 2021
1 parent 1061485 commit abd0b91
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions test/pathname/test_pathname.rb
Original file line number Diff line number Diff line change
Expand Up @@ -815,17 +815,17 @@ def test_atime
end

def test_birthtime
skip if RUBY_PLATFORM =~ /android/
omit if RUBY_PLATFORM =~ /android/
# Check under a (probably) local filesystem.
# Remote filesystems often may not support birthtime.
with_tmpchdir('rubytest-pathname') do |dir|
open("a", "w") {}
assert_kind_of(Time, Pathname("a").birthtime)
rescue Errno::EPERM
# Docker prohibits statx syscall by the default.
skip("statx(2) is prohibited by seccomp")
omit("statx(2) is prohibited by seccomp")
rescue Errno::ENOSYS
skip("statx(2) is not supported on this filesystem")
omit("statx(2) is not supported on this filesystem")
rescue NotImplementedError
# assert_raise(NotImplementedError) do
# File.birthtime("a")
Expand Down Expand Up @@ -1120,7 +1120,7 @@ def test_exist?
end

def test_grpowned?
skip "Unix file owner test" if DOSISH
omit "Unix file owner test" if DOSISH
with_tmpchdir('rubytest-pathname') {|dir|
open("f", "w") {|f| f.write "abc" }
File.chown(-1, Process.gid, "f")
Expand Down Expand Up @@ -1175,7 +1175,7 @@ def test_readable?
end

def test_world_readable?
skip "Unix file mode bit test" if DOSISH
omit "Unix file mode bit test" if DOSISH
with_tmpchdir('rubytest-pathname') {|dir|
open("f", "w") {|f| f.write "abc" }
File.chmod(0400, "f")
Expand Down Expand Up @@ -1227,7 +1227,7 @@ def test_size?
end

def test_sticky?
skip "Unix file mode bit test" if DOSISH
omit "Unix file mode bit test" if DOSISH
with_tmpchdir('rubytest-pathname') {|dir|
open("f", "w") {|f| f.write "abc" }
assert_equal(false, Pathname("f").sticky?)
Expand All @@ -1249,7 +1249,7 @@ def test_writable?
end

def test_world_writable?
skip "Unix file mode bit test" if DOSISH
omit "Unix file mode bit test" if DOSISH
with_tmpchdir('rubytest-pathname') {|dir|
open("f", "w") {|f| f.write "abc" }
File.chmod(0600, "f")
Expand Down Expand Up @@ -1409,8 +1409,8 @@ def test_find
a = []; Pathname("d").find(ignore_error: true) {|v| a << v }; a.sort!
assert_equal([Pathname("d"), Pathname("d/x")], a)

skip "no meaning test on Windows" if /mswin|mingw/ =~ RUBY_PLATFORM
skip 'skipped in root privilege' if Process.uid == 0
omit "no meaning test on Windows" if /mswin|mingw/ =~ RUBY_PLATFORM
omit 'skipped in root privilege' if Process.uid == 0
a = [];
assert_raise_with_message(Errno::EACCES, %r{d/x}) do
Pathname(".").find(ignore_error: false) {|v| a << v }
Expand Down
2 changes: 1 addition & 1 deletion test/pathname/test_ractor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class TestPathnameRactor < Test::Unit::TestCase
def setup
skip unless defined? Ractor
omit unless defined? Ractor
end

def test_ractor_shareable
Expand Down

0 comments on commit abd0b91

Please sign in to comment.