Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rspec upgrade #43

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ source 'http://rubygems.org'

gem 'coveralls', require: false
gem 'celluloid', github: 'celluloid/celluloid', branch: 'master'
gem 'transpec', github: 'yujinakayama/transpec', tag: 'v3.1.0'

# Specify your gem's dependencies in celluloid-zmq.gemspec
gemspec
2 changes: 1 addition & 1 deletion celluloid-zmq.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
gem.add_dependency "ffi-rzmq"

gem.add_development_dependency "rake"
gem.add_development_dependency "rspec", "~> 2.14.0"
gem.add_development_dependency "rspec", "~> 3.0"

# Files
ignores = File.read(".gitignore").split(/\r?\n/).reject{ |f| f =~ /^(#.+|\s*)$/ }.map {|f| Dir[f] }.flatten
Expand Down
3 changes: 1 addition & 2 deletions lib/celluloid/zmq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ def included(klass)

# Obtain a 0MQ context
def init(worker_threads = 1)
return @context if @context
@context = ::ZMQ::Context.new(worker_threads)
@context ||= ::ZMQ::Context.new(worker_threads)
end

def context
Expand Down
1 change: 1 addition & 0 deletions spec/celluloid/zmq/socket_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
identity = socket.get(::ZMQ::IDENTITY)

expect(identity).to eq("Identity")
socket.close
end

end
2 changes: 1 addition & 1 deletion spec/celluloid/zmq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def close_socket
client.recv_string(message)
expect(message).to eq("hello world")

expect(result.value).to be_true
expect(result.value).to be_truthy
end
end
end
4 changes: 1 addition & 3 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
Celluloid.shutdown_timeout = 1

RSpec.configure do |config|
config.treat_symbols_as_metadata_keys_with_true_values = true

config.around do |ex|
Celluloid::ZMQ.init(1) unless example.metadata[:no_init]
Celluloid::ZMQ.init(1) unless ex.metadata[:no_init]
Celluloid.boot
ex.run
Celluloid.shutdown
Expand Down