aboutsummaryrefslogtreecommitdiffstats
path: root/test/core/test_event.rb
blob: e8bff6d76bc2ac471064f68b3ac04fcb497b6bbb (plain)
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
# -*- coding: utf-8 -*-

require File.expand_path(File.dirname(__FILE__) + '/../helper')

Dir.chdir(File.expand_path(File.dirname(__FILE__) + '/../core'))
$LOAD_PATH.push '.'
require 'utils'

miquire :lib, 'test_unit_extensions'
miquire :core, 'event'

class TC_Event < Test::Unit::TestCase
  def setup
    Event.clear!
  end

  must "register" do
    assert_instance_of Event, Event[:register_test]
    assert Event[:register_test].eql? Event[:register_test]
    assert_raise(ArgumentError) {
      Event["fail"] }
  end

  must "priority" do
    assert_kind_of Symbol, Event[:prio1].priority
    Event[:prio1].options[:priority] = :ui_response
    assert_equal :ui_response, Event[:prio1].priority
  end
end