Sha256: 27b4358eade912a20f07179b87a8682f64f66d3320b759f06becf1c79bdca692

Contents?: true

Size: 1.18 KB

Versions: 11

Compression:

Stored size: 1.18 KB

Contents

# -*- coding: utf-8 -*-
require 'spec_helper'

describe "uc52_commit_event_after_all_handler_submit" do
  before do
    Tengine::Core::Driver.delete_all
    Tengine::Core::Session.delete_all
    config = Tengine::Core::Config::Core.new({
        :tengined => {
          :load_path => File.expand_path('../../../../examples/uc52_commit_event_after_all_handler_submit.rb', File.dirname(__FILE__)),
        },
      })
    @bootstrap = Tengine::Core::Bootstrap.new(config)
    @kernel = @bootstrap.send(:kernel)
    @bootstrap.load_dsl
    @kernel.bind
  end

  it "必ずACKされている" do
    context = @kernel.context
    STDOUT.should_receive(:puts).with("handler52_1 unacknowledged")
    STDOUT.should_receive(:puts).with("handler52_2 unacknowledged")
    STDOUT.should_receive(:puts).with("handler52_3 unacknowledged")
    mock_headers = mock(:headers)
    @kernel.after_delegate = lambda do
      # ハンドラへの処理の委譲後(=すべてのハンドラの実行終了後)ackが呼び出されるはず
      mock_headers.should_receive(:ack)
    end
    raw_event = Tengine::Event.new(:event_type_name => "event52")
    @kernel.process_message(mock_headers, raw_event.to_json)
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
tengine_core-0.5.39 spec/tengine/core/dsls/uc52_commit_event_after_all_handler_submit_spec.rb
tengine_core-0.5.38 spec/tengine/core/dsls/uc52_commit_event_after_all_handler_submit_spec.rb
tengine_core-0.5.37 spec/tengine/core/dsls/uc52_commit_event_after_all_handler_submit_spec.rb
tengine_core-0.5.36 spec/tengine/core/dsls/uc52_commit_event_after_all_handler_submit_spec.rb
tengine_core-0.5.35 spec/tengine/core/dsls/uc52_commit_event_after_all_handler_submit_spec.rb
tengine_core-0.5.34 spec/tengine/core/dsls/uc52_commit_event_after_all_handler_submit_spec.rb
tengine_core-0.5.33 spec/tengine/core/dsls/uc52_commit_event_after_all_handler_submit_spec.rb
tengine_core-0.5.32 spec/tengine/core/dsls/uc52_commit_event_after_all_handler_submit_spec.rb
tengine_core-0.5.31 spec/tengine/core/dsls/uc52_commit_event_after_all_handler_submit_spec.rb
tengine_core-0.5.30 spec/tengine/core/dsls/uc52_commit_event_after_all_handler_submit_spec.rb
tengine_core-0.5.28 spec/tengine/core/dsls/uc52_commit_event_after_all_handler_submit_spec.rb