ione 1.2.4 → 1.3.0.pre0

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,7 +7,7 @@ module Ione
7
7
  module Io
8
8
  describe SslAcceptor do
9
9
  let :acceptor do
10
- described_class.new('example.com', 4321, 3, unblocker, reactor, ssl_context, socket_impl, ssl_socket_impl)
10
+ described_class.new('example.com', 4321, backlog = 3, unblocker, reactor, ssl_context, socket_impl, ssl_socket_impl)
11
11
  end
12
12
 
13
13
  let :unblocker do
@@ -80,8 +80,8 @@ module Ione
80
80
  acceptor.bind
81
81
  acceptor.read
82
82
  accepted_handlers.should have(1).item
83
- accepted_handlers.first.host.should eq('example.com')
84
- accepted_handlers.first.port.should eq(3333)
83
+ accepted_handlers.first.host.should == 'example.com'
84
+ accepted_handlers.first.port.should == 3333
85
85
  end
86
86
 
87
87
  it 'returns the raw socket from #to_io' do
@@ -124,7 +124,7 @@ module Ione
124
124
  end
125
125
  handler.connect
126
126
  handler.read
127
- read_sizes.drop(1).should eq([read_sizes.first] * 3)
127
+ read_sizes.drop(1).should == [read_sizes.first] * 3
128
128
  end
129
129
  else
130
130
  it 'reads and initial chunk of data' do
@@ -134,7 +134,7 @@ module Ione
134
134
  ssl_socket.stub(:read_nonblock).and_return('fooo')
135
135
  handler.connect
136
136
  handler.read
137
- data.should eq(['fooo'])
137
+ data.should == ['fooo']
138
138
  end
139
139
 
140
140
  it 'reads once, and then again with the value of #pending, until #pending returns zero' do
@@ -149,7 +149,7 @@ module Ione
149
149
  end
150
150
  handler.connect
151
151
  handler.read
152
- read_sizes.drop(1).should eq([3, 2, 1])
152
+ read_sizes.drop(1).should == [3, 2, 1]
153
153
  end
154
154
  end
155
155
 
@@ -6,6 +6,7 @@ require 'bundler/setup'
6
6
 
7
7
  require 'support/fake_server'
8
8
  require 'support/await_helper'
9
+ require 'support/server_helper'
9
10
 
10
11
  unless ENV['COVERAGE'] == 'no' || RUBY_ENGINE == 'rbx'
11
12
  require 'coveralls'
@@ -23,8 +24,4 @@ unless ENV['COVERAGE'] == 'no' || RUBY_ENGINE == 'rbx'
23
24
  end
24
25
  end
25
26
 
26
- RSpec.configure do |config|
27
- config.warnings = true
28
- end
29
-
30
27
  require 'ione'
@@ -11,7 +11,6 @@ class FakeServer
11
11
  @disconnects = 0
12
12
  @connections = []
13
13
  @received_bytes = ''
14
- @running = false
15
14
  end
16
15
 
17
16
  def start(options={})
@@ -0,0 +1,15 @@
1
+ # encoding: utf-8
2
+
3
+ module ServerHelper
4
+ def with_server
5
+ TCPServer.open(0) do |server|
6
+ thread = Thread.start { server.accept }
7
+ yield server.addr[3], server.addr[1]
8
+ thread.value
9
+ end
10
+ end
11
+ end
12
+
13
+ RSpec.configure do |c|
14
+ c.include(ServerHelper)
15
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ione
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.3.0.pre0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Theo Hultberg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-26 00:00:00.000000000 Z
11
+ date: 2015-11-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Reactive programming framework for Ruby, painless evented IO, futures
14
14
  and an efficient byte buffer
@@ -50,6 +50,7 @@ files:
50
50
  - spec/spec_helper.rb
51
51
  - spec/support/await_helper.rb
52
52
  - spec/support/fake_server.rb
53
+ - spec/support/server_helper.rb
53
54
  homepage: http://github.com/iconara/ione
54
55
  licenses:
55
56
  - Apache License 2.0
@@ -65,12 +66,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
65
66
  version: 1.9.3
66
67
  required_rubygems_version: !ruby/object:Gem::Requirement
67
68
  requirements:
68
- - - ">="
69
+ - - ">"
69
70
  - !ruby/object:Gem::Version
70
- version: '0'
71
+ version: 1.3.1
71
72
  requirements: []
72
73
  rubyforge_project:
73
- rubygems_version: 2.4.5
74
+ rubygems_version: 2.2.2
74
75
  signing_key:
75
76
  specification_version: 4
76
77
  summary: Reactive programming framework for Ruby
@@ -91,4 +92,5 @@ test_files:
91
92
  - spec/spec_helper.rb
92
93
  - spec/support/await_helper.rb
93
94
  - spec/support/fake_server.rb
95
+ - spec/support/server_helper.rb
94
96
  has_rdoc: