File: tcp_server_spec.rb

package info (click to toggle)
thin 1.3.1-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,084 kB
  • sloc: ruby: 4,138; ansic: 1,537; sh: 82; makefile: 8
file content (33 lines) | stat: -rw-r--r-- 617 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
require 'spec_helper'

describe Backends::TcpServer do
  before do
    @backend = Backends::TcpServer.new('0.0.0.0', 3333)
  end
  
  it "should not use epoll" do
    @backend.no_epoll = true
    EventMachine.should_not_receive(:epoll)
    @backend.config
  end
  
  it "should use epoll" do
    EventMachine.should_receive(:epoll)
    @backend.config
  end
  
  it "should connect" do
    EventMachine.run do
      @backend.connect
      EventMachine.stop
    end
  end
  
  it "should disconnect" do
    EventMachine.run do
      @backend.connect
      @backend.disconnect
      EventMachine.stop
    end
  end
end