class TestActPlugin

Public Instance Methods

ok(e, s) click to toggle source
# File vendor/qwik/lib/qwik/common-plugin.rb, line 72
def ok(e, s)
  eq e, Qwik::Action.plugin_parse_args(s)
end
ok_plugin(e, ar) click to toggle source
# File vendor/qwik/lib/qwik/common-plugin.rb, line 84
def ok_plugin(e, ar)
  eq e, @action.c_call_plugin(*ar)
end
test_all() click to toggle source
# File vendor/qwik/lib/qwik/common-plugin.rb, line 88
def test_all
  res = session

  # test_from_local?
  c = Qwik::Action
  eq true, c.from_local?('localhost')
  eq true, c.from_local?('win')
  eq true, c.from_local?('127.0.0.1')
  eq true, c.from_local?('192.168.0.1')
  eq true, c.from_local?('192.168.2.1')
  eq false, c.from_local?('www.example.com')

  # test_call_plugin
  ok_plugin 'test', ['qwik_test', '']
  ok_plugin [:span, {:class=>'plg_error'}, 'nosuch plugin | ',
    [:strong, 'nosuch']], ['nosuch', '']

  t_without_testmode {
    res = @action.c_call_plugin('_qwik_test_for_raise_exception', '')
    eq :h3, res[0][0]
  }
end
test_parse_args() click to toggle source
# File vendor/qwik/lib/qwik/common-plugin.rb, line 76
def test_parse_args
  ok ['a'], "'a'"
  ok ['a'], "\"a\""
  ok ['<'], '<'
  ok ['<'], "'<'"
  ok ['a b'], 'a b'
end