Sha256: 795ae8665010468e506ed530f1b84ecdd2f7d136d0748411cf0fd76da4583dd1

Contents?: true

Size: 976 Bytes

Versions: 11

Compression:

Stored size: 976 Bytes

Contents

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

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

  it "必ずACKされている" do
    STDOUT.should_receive(:puts).with("handler50 acknowledged")
    mock_headers = mock(:headers)
    mock_headers.should_receive(:ack)
    raw_event = Tengine::Event.new(:event_type_name => "event50")
    @kernel.before_delegate = lambda do
      # ハンドラへの処理の委譲後(=すべてのハンドラの実行終了後)ackが呼び出されるはず
      mock_headers.should_not_receive(:ack)
    end
    @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/uc50_commit_event_at_first_spec.rb
tengine_core-0.5.38 spec/tengine/core/dsls/uc50_commit_event_at_first_spec.rb
tengine_core-0.5.37 spec/tengine/core/dsls/uc50_commit_event_at_first_spec.rb
tengine_core-0.5.36 spec/tengine/core/dsls/uc50_commit_event_at_first_spec.rb
tengine_core-0.5.35 spec/tengine/core/dsls/uc50_commit_event_at_first_spec.rb
tengine_core-0.5.34 spec/tengine/core/dsls/uc50_commit_event_at_first_spec.rb
tengine_core-0.5.33 spec/tengine/core/dsls/uc50_commit_event_at_first_spec.rb
tengine_core-0.5.32 spec/tengine/core/dsls/uc50_commit_event_at_first_spec.rb
tengine_core-0.5.31 spec/tengine/core/dsls/uc50_commit_event_at_first_spec.rb
tengine_core-0.5.30 spec/tengine/core/dsls/uc50_commit_event_at_first_spec.rb
tengine_core-0.5.28 spec/tengine/core/dsls/uc50_commit_event_at_first_spec.rb