require 'abstract_unit'
require 'active_support/core_ext/kernel/concern'

class KernelConcernTest < ActiveSupport::TestCase
  def test_may_be_defined_at_toplevel
    mod = ::TOPLEVEL_BINDING.eval 'concern(:ToplevelConcern) { }'
    assert_equal mod, ::ToplevelConcern
    assert_kind_of ActiveSupport::Concern, ::ToplevelConcern
    assert !Object.ancestors.include?(::ToplevelConcern), mod.ancestors.inspect
    Object.send :remove_const, :ToplevelConcern
  end
end

require 'abstract_unit'
require 'active_support/core_ext/kernel/concern'

class KernelConcernTest < ActiveSupport::TestCase
  def test_may_be_defined_at_toplevel
    mod = ::TOPLEVEL_BINDING.eval 'concern(:ToplevelConcern) { }'
    assert_equal mod, ::ToplevelConcern
    assert_kind_of ActiveSupport::Concern, ::ToplevelConcern
    assert_not Object.ancestors.include?(::ToplevelConcern), mod.ancestors.inspect
  ensure
    Object.send :remove_const, :ToplevelConcern
  end
end

Move test teardown into `ensure` block.
Move test teardown into `ensure` block.
