Add "chdir" method. Can be used to avoid ruby warning "conflicting
chdir during another chdir block".
This commit is contained in:
parent
a533ee1300
commit
1f504f5f9b
@ -115,6 +115,20 @@ module Cmdtest
|
|||||||
FileUtils.touch(filename)
|
FileUtils.touch(filename)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#------------------------------
|
||||||
|
# A "chdir" to be used in tests, to avoid the Ruby warning:
|
||||||
|
#
|
||||||
|
# warning: conflicting chdir during another chdir block
|
||||||
|
#
|
||||||
|
|
||||||
|
def chdir(dir, &block)
|
||||||
|
if block_given?
|
||||||
|
Util.chdir(dir, &block)
|
||||||
|
else
|
||||||
|
Dir.chdir(dir)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
#------------------------------
|
#------------------------------
|
||||||
# Don't count the specified file when calculating the "side effects"
|
# Don't count the specified file when calculating the "side effects"
|
||||||
# of a command.
|
# of a command.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user