Skip to content

Commit

Permalink
refactored to reduce flay score. marked some stuff as nodoc because r…
Browse files Browse the repository at this point in the history
…doc kinda sucks (STILL)

[git-p4: depot-paths = "//src/minitest/dev/": change = 7650]
  • Loading branch information
zenspider committed Jul 19, 2012
1 parent 924b5e4 commit ef5507b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/minitest/mock.rb
Expand Up @@ -50,7 +50,7 @@ def expect(name, retval, args=[])
self
end

def __call name, data
def __call name, data # :nodoc:
case data
when Hash then
"#{name}(#{data[:args].inspect[1..-2]}) => #{data[:retval].inspect}"
Expand Down
16 changes: 7 additions & 9 deletions lib/minitest/unit.rb
Expand Up @@ -1239,7 +1239,11 @@ def self.setup_hooks # :nodoc:
end

def run_setup_hooks # :nodoc:
self.class.setup_hooks.each do |hook|
_run_hooks self.class.setup_hooks
end

def _run_hooks hooks # :nodoc:
hooks.each do |hook|
if hook.respond_to?(:arity) && hook.arity == 1
hook.call(self)
else
Expand Down Expand Up @@ -1288,21 +1292,15 @@ def self.teardown_hooks # :nodoc:
end

def run_teardown_hooks # :nodoc:
self.class.teardown_hooks.reverse.each do |hook|
if hook.respond_to?(:arity) && hook.arity == 1
hook.call(self)
else
hook.call
end
end
_run_hooks self.class.teardown_hooks
end

include MiniTest::Assertions
end # class TestCase
end # class Unit
end # module MiniTest

Minitest = MiniTest # because ugh... I typo this all the time
Minitest = MiniTest # :nodoc: because ugh... I typo this all the time

if $DEBUG then
module Test # :nodoc:
Expand Down

0 comments on commit ef5507b

Please sign in to comment.