Sha256: 4a30e58105682a9851468be2fab09631a69aa1305eb913829d35d20980ebca0d

Contents?: true

Size: 706 Bytes

Versions: 37

Compression:

Stored size: 706 Bytes

Contents

## 
# Mock for EventMachine
module EventMachine

  def self.mock?
    true
  end

  ##
  # Mock for the Connection Class
  class Connection
    def self.new(*args)
      allocate.instance_eval do
        # Call a superclass's #initialize if it has one
        initialize(*args)
        # Store signature and run #post_init
        post_init
        self
      end
    end
  end

  ##
  # Stub for run
  def self.run(proc)
    proc.call
  end

  ##
  # Stub for epoll
  def self.epoll; end

  ##
  # Stub! to stop the event loop.
  def self.stop_event_loop; end

  ##
  # Stub for connect (should return a connection object)
  def self.connect(host, port, handler, params)
    handler.new(params)
  end
end

Version data entries

37 entries across 37 versions & 4 rubygems

Version Path
julien51-babylon-0.1.10 spec/em_mock.rb
julien51-babylon-0.1.11 spec/em_mock.rb
julien51-babylon-0.1.2 spec/em_mock.rb
julien51-babylon-0.1.3 spec/em_mock.rb
julien51-babylon-0.1.4 spec/em_mock.rb
julien51-babylon-0.1.5 spec/em_mock.rb
julien51-babylon-0.1.6 spec/em_mock.rb
julien51-babylon-0.1.7 spec/em_mock.rb
julien51-babylon-0.1.8 spec/em_mock.rb
julien51-babylon-0.1.9 spec/em_mock.rb
mohiam-babylon-0.1.7 spec/em_mock.rb
skates-0.5.0 spec/em_mock.rb
skates-0.4.0 spec/em_mock.rb
skates-0.3.6 spec/em_mock.rb
radamanthus-skates-0.3.5 spec/em_mock.rb
skates-0.3.5 spec/em_mock.rb
skates-0.3.4 spec/em_mock.rb
skates-0.3.3 spec/em_mock.rb
skates-0.3.2 spec/em_mock.rb
skates-0.3.1 spec/em_mock.rb