1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
require './spec/helper'
require 'minitest/hooks/default'
describe 'Minitest::Hooks error handling' do
before(:all) do
name.must_equal 'before_all'
end
after(:all) do
name.must_equal 'after_all'
end
around(:all) do |&block|
name.must_equal 'around_all'
super(&block)
name.must_equal 'around_all'
end
3.times do |i|
it "should work try #{i}" do
end
end
end
class MinitestHooksNameTest < Minitest::Test
include Minitest::Hooks
def before_all
assert_equal 'before_all', name
end
def after_all
assert_equal 'after_all', name
end
def around_all
assert_equal 'around_all', name
super
assert_equal 'around_all', name
end
3.times do |i|
define_method "test_should_work_try_#{i}" do
end
end
end
|