Skip to content

Commit

Permalink
re-sorted assertions after path additions
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//src/minitest/dev/": change = 12353]
  • Loading branch information
zenspider committed Oct 20, 2019
1 parent 158bd6c commit dcac10a
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions lib/minitest/assertions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,14 @@ def assert_output stdout = nil, stderr = nil
(!stdout || x) && (!stderr || y)
end

##
# Fails unless +path+ exists.

def assert_path_exists path, msg = nil
msg = message(msg) { "Expected path '#{path}' to exist" }
assert File.exist?(path), msg
end

##
# For testing with predicates. Eg:
#
Expand Down Expand Up @@ -481,14 +489,6 @@ def assert_throws sym, msg = nil
assert caught, message(msg) { default }
end

##
# Fails unless +path+ exists.

def assert_path_exists path, msg = nil
msg = message(msg) { "Expected path '#{path}' to exist" }
assert File.exist?(path), msg
end

##
# Captures $stdout and $stderr into strings:
#
Expand Down Expand Up @@ -712,6 +712,14 @@ def refute_operator o1, op, o2 = UNDEFINED, msg = nil
refute o1.__send__(op, o2), msg
end

##
# Fails if +path+ exists.

def refute_path_exists path, msg = nil
msg = message(msg) { "Expected path '#{path}' to not exist" }
refute File.exist?(path), msg
end

##
# For testing with predicates.
#
Expand Down Expand Up @@ -746,14 +754,6 @@ def refute_same exp, act, msg = nil
refute exp.equal?(act), msg
end

##
# Fails if +path+ exists.

def refute_path_exists path, msg = nil
msg = message(msg) { "Expected path '#{path}' to not exist" }
refute File.exist?(path), msg
end

##
# Skips the current run. If run in verbose-mode, the skipped run
# gets listed at the end of the run but doesn't cause a failure
Expand Down

0 comments on commit dcac10a

Please sign in to comment.