Sha256: f4e968efd8662a5cf3a16326d5e9c2f1b3f71993500efd56e7b7f20ef5671c8f
Contents?: true
Size: 815 Bytes
Versions: 18
Compression:
Stored size: 815 Bytes
Contents
#!/usr/bin/env ruby require 'test/unit' require 'rubygems'; require 'require_relative' require_relative '../../processor/hook' # Test Debugger:CmdProcessor Hook portion class TestProcHook < Test::Unit::TestCase def test_basic @args = [] hook1 = Proc.new {|name, a| @args << [name, a]} hooks = Trepan::CmdProcessor::Hook.new() assert_equal(true, hooks.empty?) hooks.insert(-1, 'hook1', hook1) hooks.run assert_equal([['hook1', nil]], @args) hooks.insert_if_new(-1, 'hook1', hook1) assert_equal([['hook1', nil]], @args) @args = [] hooks.insert_if_new(-1, 'hook2', hook1) hooks.run(10) assert_equal([['hook1', 10], ['hook2', 10]], @args) @args = [] hooks.delete_by_name('hook2') hooks.run(30) assert_equal([['hook1', 30]], @args) end end
Version data entries
18 entries across 18 versions & 2 rubygems