Sha256: 2bf9ce18f17e76412d7d5d221bfbac3413952a605e0a821ec286c06e598ea248

Contents?: true

Size: 1011 Bytes

Versions: 11

Compression:

Stored size: 1011 Bytes

Contents

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

describe "uc62_session_in_driver" 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/uc60_event_in_handler.rb', File.dirname(__FILE__)),
        },
      })
    @bootstrap = Tengine::Core::Bootstrap.new(config)
    @bootstrap.load_dsl
    @kernel = Tengine::Core::Kernel.new(config)
    @kernel.bind
  end

  it "ロード後にはsessionに値が入っている" do
    driver = Tengine::Core::Driver.first
    klass = driver.target_class_name.constantize
    obj = klass.new
    klass.should_receive(:new).and_return(obj)
    obj.should_receive(:puts).with(/^handler60: \[.*\]$/)

    mock_headers = mock(:headers)
    mock_headers.should_receive(:ack)
    raw_event = Tengine::Event.new(:event_type_name => "event60")
    @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/uc60_event_in_handler_spec.rb
tengine_core-0.5.38 spec/tengine/core/dsls/uc60_event_in_handler_spec.rb
tengine_core-0.5.37 spec/tengine/core/dsls/uc60_event_in_handler_spec.rb
tengine_core-0.5.36 spec/tengine/core/dsls/uc60_event_in_handler_spec.rb
tengine_core-0.5.35 spec/tengine/core/dsls/uc60_event_in_handler_spec.rb
tengine_core-0.5.34 spec/tengine/core/dsls/uc60_event_in_handler_spec.rb
tengine_core-0.5.33 spec/tengine/core/dsls/uc60_event_in_handler_spec.rb
tengine_core-0.5.32 spec/tengine/core/dsls/uc60_event_in_handler_spec.rb
tengine_core-0.5.31 spec/tengine/core/dsls/uc60_event_in_handler_spec.rb
tengine_core-0.5.30 spec/tengine/core/dsls/uc60_event_in_handler_spec.rb
tengine_core-0.5.28 spec/tengine/core/dsls/uc60_event_in_handler_spec.rb