Skip to content

Commit

Permalink
* lib/test/unit/assertions.rb (Test::Unit::Assertions): aliases
Browse files Browse the repository at this point in the history
  assert_not_ methods.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Feb 15, 2009
1 parent 1f125ad commit 8fc4547
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Sun Feb 15 21:22:48 2009 Nobuyoshi Nakada <[email protected]>

* lib/test/unit/assertions.rb (Test::Unit::Assertions): aliases
assert_not_ methods.

Sun Feb 15 16:57:35 2009 Tanaka Akira <[email protected]>

* lib/securerandom.rb (SecureRandom.urlsafe_base64): new method.
Expand Down
4 changes: 4 additions & 0 deletions lib/test/unit/assertions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ def assert_respond_to obj, meth, msg = nil
super if !caller[0].rindex(MiniTest::MINI_DIR, 0) || !obj.respond_to?(meth)
end

instance_methods(true).grep(/\Arefute_/) do |m|
alias_method(('assert_not_' << m.to_s[/.*?_(.*)/, 1]), m)
end

def build_message(head, template=nil, *arguments)
template &&= template.chomp
template.gsub(/\?/) { mu_pp(arguments.shift) }
Expand Down

0 comments on commit 8fc4547

Please sign in to comment.