
class ScriptBug < Exception; end

module Kernel
  # Raises a ScritBug error with a message.
  #
  #   if find_bug then
  #     bug! "unknown bug found"
  #   end
  #
  #--
  # Credit goes to Minero Aoki. Cute! :-)
  #++
  def bug!( message = 'must not happen' )
    raise ScriptBug, "\n[SCRIPT BUG] " + message
  end
end



#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
=begin test

  require 'test/unit'

  class TCKernel < Test::Unit::TestCase

    def test_bug!
      assert_raises( ScriptBug ) { bug! }
    end

  end

=end
