Skip to content
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.

Commit

Permalink
Fixes for celluloid head.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Mar 26, 2017
1 parent b54b7ac commit 0efd142
Show file tree
Hide file tree
Showing 9 changed files with 131 additions and 33 deletions.
2 changes: 2 additions & 0 deletions .rspec
@@ -1,2 +1,4 @@
--color
--format documentation
--warnings
--require spec_helper
15 changes: 0 additions & 15 deletions .simplecov

This file was deleted.

3 changes: 3 additions & 0 deletions Gemfile
Expand Up @@ -2,6 +2,9 @@ source 'https://rubygems.org'

gemspec

gem "celluloid", github: 'celluloid/celluloid'
# gem "celluloid-io", github: 'celluloid/celluloid-io'

group :test do
gem 'simplecov'
gem 'coveralls', require: false
Expand Down
83 changes: 83 additions & 0 deletions Gemfile.lock
@@ -0,0 +1,83 @@
GIT
remote: git://github.com/celluloid/celluloid.git
revision: a635787672fb0789af1b402c603af135557c31aa
specs:
celluloid (0.18.0.pre)
celluloid-pool (~> 0.20)
celluloid-supervision (~> 0.20)
timers (~> 4)

PATH
remote: .
specs:
celluloid-dns (0.17.3)
celluloid (~> 0.17)
celluloid-io (~> 0.17)
timers (~> 4.1.0)

GEM
remote: https://rubygems.org/
specs:
celluloid-io (0.17.3)
celluloid (>= 0.17.2)
nio4r (>= 1.1)
timers (>= 4.1.1)
celluloid-pool (0.20.5)
timers (>= 4.1.1)
celluloid-supervision (0.20.6)
timers (>= 4.1.1)
coveralls (0.8.19)
json (>= 1.8, < 3)
simplecov (~> 0.12.0)
term-ansicolor (~> 1.3)
thor (~> 0.19.1)
tins (~> 1.6)
diff-lcs (1.3)
docile (1.1.5)
hitimes (1.2.4)
json (2.0.3)
nio4r (2.0.0)
process-daemon (1.0.1)
rainbow (~> 2.0)
rainbow (2.2.1)
rake (12.0.0)
rspec (3.4.0)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)
rspec-mocks (~> 3.4.0)
rspec-core (3.4.4)
rspec-support (~> 3.4.0)
rspec-expectations (3.4.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-mocks (3.4.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-support (3.4.1)
simplecov (0.12.0)
docile (~> 1.1.0)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
term-ansicolor (1.4.1)
tins (~> 1.0)
thor (0.19.4)
timers (4.1.2)
hitimes
tins (1.13.2)

PLATFORMS
ruby

DEPENDENCIES
bundler (~> 1.3)
celluloid!
celluloid-dns!
coveralls
process-daemon (~> 1.0.0)
rake
rspec (~> 3.4.0)
simplecov

BUNDLED WITH
1.14.6
4 changes: 2 additions & 2 deletions celluloid-dns.gemspec
Expand Up @@ -23,8 +23,8 @@ Gem::Specification.new do |spec|

spec.required_ruby_version = '>= 2.0.0'

spec.add_dependency("celluloid", "~> 0.17.3")
spec.add_dependency("celluloid-io", "~> 0.17.3")
spec.add_dependency("celluloid", "~> 0.17")
spec.add_dependency("celluloid-io", "~> 0.17")
spec.add_dependency("timers", "~> 4.1.0")

spec.add_development_dependency "bundler", "~> 1.3"
Expand Down
3 changes: 0 additions & 3 deletions spec/celluloid/dns/resolver_spec.rb
Expand Up @@ -75,9 +75,6 @@ def handle_connection(socket)
end

before(:all) do
Celluloid.shutdown
Celluloid.boot

JunkUDPServer.supervise
JunkTCPServer.supervise
end
Expand Down
10 changes: 2 additions & 8 deletions spec/celluloid/dns/server_performance_spec.rb
Expand Up @@ -83,8 +83,6 @@ def self.named_executable
end

before(:all) do
Celluloid.shutdown

@servers = []
@servers << ["Celluloid::DNS::Server", 5300]

Expand All @@ -98,10 +96,6 @@ def self.named_executable
Bind9ServerDaemon.start
@servers << ["Bind9", 5400]
end

sleep 2

Celluloid.boot
end

after(:all) do
Expand All @@ -113,8 +107,8 @@ def self.named_executable
end

it 'takes time' do
# Celluloid.logger.level = Logger::ERROR

Celluloid.logger.level = Logger::ERROR
Benchmark.bm(30) do |x|
@servers.each do |name, port|
resolver = Celluloid::DNS::Resolver.new([[:udp, '127.0.0.1', port]])
Expand Down
5 changes: 0 additions & 5 deletions spec/celluloid/dns/system_spec.rb
Expand Up @@ -25,11 +25,6 @@

module Celluloid::DNS::SystemSpec
describe Celluloid::DNS::System do
before(:all) do
Celluloid.shutdown
Celluloid.boot
end

it "should have at least one namesever" do
expect(Celluloid::DNS::System::nameservers.length).to be > 0
end
Expand Down
39 changes: 39 additions & 0 deletions spec/spec_helper.rb
@@ -0,0 +1,39 @@

if ENV['COVERAGE'] || ENV['TRAVIS']
begin
require 'simplecov'

SimpleCov.start do
add_filter "/spec/"
end

# Work correctly across forks:
pid = Process.pid
SimpleCov.at_exit do
SimpleCov.result.format! if Process.pid == pid
end

if ENV['TRAVIS']
require 'coveralls'
Coveralls.wear!
end
rescue LoadError
warn "Could not load simplecov: #{$!}"
end
end

require "bundler/setup"
require "celluloid/dns"

abort "Warning, ulimit is too low!" if `ulimit -n`.to_i < 10000

require 'celluloid/autostart'

RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"

config.expect_with :rspec do |c|
c.syntax = :expect
end
end

0 comments on commit 0efd142

Please sign in to comment.