Sha256: 239680ad8b2f2f4f50b68f573207c6570ee560c66b2d51d872fca0d444c12a9c

Contents?: true

Size: 562 Bytes

Versions: 19

Compression:

Stored size: 562 Bytes

Contents

module WebsocketRails

  class SpecHelperEvent < Event

    attr_reader :dispatcher, :triggered

    alias :triggered? :triggered

    def initialize(event_name,options={})
      super(event_name, options)
      @triggered = false
      @dispatcher =  Dispatcher.new(nil)
    end

    def trigger
      @triggered = true
    end

    def dispatch
      @dispatcher.dispatch(self)
      self
    end

    def connection
      OpenStruct.new(:id => 1)
    end

  end

end

def create_event(name, data)
  WebsocketRails::SpecHelperEvent.new(name, {data: data})
end

Version data entries

19 entries across 19 versions & 3 rubygems

Version Path
hkroger-websocket-rails-0.7.1 lib/spec_helpers/spec_helper_event.rb
wwl-websocket-rails-0.7.3 lib/spec_helpers/spec_helper_event.rb
wwl-websocket-rails-0.7.2 lib/spec_helpers/spec_helper_event.rb
wwl-websocket-rails-0.7.1 lib/spec_helpers/spec_helper_event.rb
websocket-rails-0.7.0 lib/spec_helpers/spec_helper_event.rb
websocket-rails-0.6.2 lib/spec_helpers/spec_helper_event.rb
websocket-rails-0.6.1 lib/spec_helpers/spec_helper_event.rb
websocket-rails-0.6.0 lib/spec_helpers/spec_helper_event.rb
websocket-rails-0.5.0 lib/spec_helpers/spec_helper_event.rb
websocket-rails-0.4.9 lib/spec_helpers/spec_helper_event.rb
websocket-rails-0.4.8 lib/spec_helpers/spec_helper_event.rb
websocket-rails-0.4.7 lib/spec_helpers/spec_helper_event.rb
websocket-rails-0.4.6 lib/spec_helpers/spec_helper_event.rb
websocket-rails-0.4.5 lib/spec_helpers/spec_helper_event.rb
websocket-rails-0.4.4 lib/spec_helpers/spec_helper_event.rb
websocket-rails-0.4.3 lib/spec_helpers/spec_helper_event.rb
websocket-rails-0.4.2 lib/spec_helpers/spec_helper_event.rb
websocket-rails-0.4.1 lib/spec_helpers/spec_helper_event.rb
websocket-rails-0.4.0 lib/spec_helpers/spec_helper_event.rb