Sha256: a99aa17a108ae7e813a4504ceb42e14cc473170b9a180d1458930603ddba20df

Contents?: true

Size: 1.14 KB

Versions: 2

Compression:

Stored size: 1.14 KB

Contents

require File.dirname(__FILE__) + "/test_helper.rb"

# context "Adhearsion::Hooks::TearDown when initializing a project" do
#   include InitializerStubs
#   test "should trap TERM and INT signals" do
#     flexmock(Adhearsion::Hooks::TearDown).should_receive(:catch_termination_signals).at_least.once
#     with_new_initializer_with_no_path_changing_behavior {}
#   end
# end

# module StandardHookBehavior
#   def test_standard_hook_behavior
#     @hook.should.respond_to(:trigger_hooks)
#     @hook.should.respond_to(:create_hook)
#   end
# end

# for hook in Adhearsion::Hooks.constants.map { |c| (Adhearsion::Hooks.const_get c) }
#   describe hook.to_s do
#     include StandardHookBehavior
#     before(:each) { @hook = hook }
#   end
# end

context "A HookWithArguments" do
  test "should pass the arguments to trigger_hooks() along to each registered block" do
    hook_manager = Adhearsion::Hooks::HookWithArguments.new
    hook_manager.create_hook do |foo, bar|
      foo.should.equal :foo
      bar.should.equal :bar
      throw :inside_hook
    end
    the_following_code {
      hook_manager.trigger_hooks(:foo, :bar)
    }.should.throw :inside_hook
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
eric-adhearsion-0.7.999 spec/test_hooks.rb
sevenscale-adhearsion-0.7.1000 spec/test_hooks.rb