1 require File.dirname(__FILE__) + '/../test_helper'
3 class ExtensionTest < Test::Unit::TestCase
6 assert_equal Radiant::AdminUI.instance, Radiant::Extension.admin
9 class BasicExtensionObserver < MethodObserver
10 cattr_accessor :activate_called, :deactivate_called
11 @@activate_called = false
13 @@activate_called = true
15 @@deactivate_called = false
17 @@deactivate_called = true
22 BasicExtension.activate
23 assert BasicExtension.active?
24 BasicExtensionObserver.new.observe(BasicExtension.instance)
25 BasicExtension.activate
26 assert BasicExtension.active?
27 assert !BasicExtensionObserver.activate_called
31 assert BasicExtension.active?
32 BasicExtensionObserver.new.observe(BasicExtension.instance)
33 BasicExtension.deactivate
34 assert !BasicExtension.active?
35 assert BasicExtensionObserver.deactivate_called
36 BasicExtensionObserver.deactivate_called = false
37 BasicExtension.deactivate
38 assert !BasicExtension.active?
39 assert !BasicExtensionObserver.deactivate_called