mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update the test tool path
This commit is contained in:
parent
cbda32cd98
commit
30b4da2bc1
1 changed files with 4 additions and 4 deletions
|
@ -463,7 +463,7 @@ eom
|
||||||
ex
|
ex
|
||||||
end
|
end
|
||||||
|
|
||||||
MINI_DIR = File.join(File.dirname(File.expand_path(__FILE__)), "minitest") #:nodoc:
|
TEST_DIR = File.join(__dir__, "test/unit") #:nodoc:
|
||||||
|
|
||||||
# :call-seq:
|
# :call-seq:
|
||||||
# assert(test, [failure_message])
|
# assert(test, [failure_message])
|
||||||
|
@ -483,7 +483,7 @@ eom
|
||||||
when nil
|
when nil
|
||||||
msgs.shift
|
msgs.shift
|
||||||
else
|
else
|
||||||
bt = caller.reject { |s| s.start_with?(MINI_DIR) }
|
bt = caller.reject { |s| s.start_with?(TEST_DIR) }
|
||||||
raise ArgumentError, "assertion message must be String or Proc, but #{msg.class} was given.", bt
|
raise ArgumentError, "assertion message must be String or Proc, but #{msg.class} was given.", bt
|
||||||
end unless msgs.empty?
|
end unless msgs.empty?
|
||||||
super
|
super
|
||||||
|
@ -506,7 +506,7 @@ eom
|
||||||
return assert obj.respond_to?(meth, *priv), msg
|
return assert obj.respond_to?(meth, *priv), msg
|
||||||
end
|
end
|
||||||
#get rid of overcounting
|
#get rid of overcounting
|
||||||
if caller_locations(1, 1)[0].path.start_with?(MINI_DIR)
|
if caller_locations(1, 1)[0].path.start_with?(TEST_DIR)
|
||||||
return if obj.respond_to?(meth)
|
return if obj.respond_to?(meth)
|
||||||
end
|
end
|
||||||
super(obj, meth, msg)
|
super(obj, meth, msg)
|
||||||
|
@ -529,7 +529,7 @@ eom
|
||||||
return assert !obj.respond_to?(meth, *priv), msg
|
return assert !obj.respond_to?(meth, *priv), msg
|
||||||
end
|
end
|
||||||
#get rid of overcounting
|
#get rid of overcounting
|
||||||
if caller_locations(1, 1)[0].path.start_with?(MINI_DIR)
|
if caller_locations(1, 1)[0].path.start_with?(TEST_DIR)
|
||||||
return unless obj.respond_to?(meth)
|
return unless obj.respond_to?(meth)
|
||||||
end
|
end
|
||||||
refute_respond_to(obj, meth, msg)
|
refute_respond_to(obj, meth, msg)
|
||||||
|
|
Loading…
Reference in a new issue