mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
envutil.rb: rename member
* test/ruby/envutil.rb (Test::Unit::Assertions::AssertFile): rename member to get rid of conflict with a method of Assertions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c75f360bdf
commit
9d6798932f
1 changed files with 3 additions and 3 deletions
|
@ -317,7 +317,7 @@ eom
|
||||||
AssertFile
|
AssertFile
|
||||||
end
|
end
|
||||||
|
|
||||||
class << (AssertFile = Struct.new(:message).new)
|
class << (AssertFile = Struct.new(:failure_message).new)
|
||||||
include Assertions
|
include Assertions
|
||||||
def assert_file_predicate(predicate, *args)
|
def assert_file_predicate(predicate, *args)
|
||||||
if /\Anot_/ =~ predicate
|
if /\Anot_/ =~ predicate
|
||||||
|
@ -329,13 +329,13 @@ eom
|
||||||
mesg = "Expected file " << args.shift.inspect
|
mesg = "Expected file " << args.shift.inspect
|
||||||
mesg << mu_pp(args) unless args.empty?
|
mesg << mu_pp(args) unless args.empty?
|
||||||
mesg << "#{neg} to be #{predicate}"
|
mesg << "#{neg} to be #{predicate}"
|
||||||
mesg << " #{message}" if message
|
mesg << " #{failure_message}" if failure_message
|
||||||
assert(result, mesg)
|
assert(result, mesg)
|
||||||
end
|
end
|
||||||
alias method_missing assert_file_predicate
|
alias method_missing assert_file_predicate
|
||||||
|
|
||||||
def for(message)
|
def for(message)
|
||||||
clone.tap {|a| a.message = message}
|
clone.tap {|a| a.failure_message = message}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue