# Copyright (C) 2003-2005 Kouichirou Eto, All rights reserved.

# This is sample code to make plugin in qwikWeb.
#
# If you want to know how to make plugin, see below url.
# -> http://qwik.jp/HowToMakePlugin.html

module Qwik
  class Action
    def plg_hello
      [:strong, "hello, world!"]
    end

    def act_hello
      c_notice("hello, world!"){"hi, there."}
    end
  end
end

if $0 == __FILE__
  $LOAD_PATH << "../../lib" unless $LOAD_PATH.include?("../../lib")
  require "t/test"
  $debug = true
end

if $debug
  class TC_ActSample < Test::Unit::TestCase
    include TestSession

    def test_sample
      # test_plg_hello
      assert_wiki([:strong, "hello, world!"], "{{hello}}")

      # test act_hello
      session("/test/.hello")
      assert_xpath([:title, "hello, world!"], "//title")
    end
  end
end
