spec/celluloid/io/unix_server_spec.rb in celluloid-io-0.17.1 vs spec/celluloid/io/unix_server_spec.rb in celluloid-io-0.17.2

- old
+ new

@@ -1,23 +1,22 @@ -require 'spec_helper' +require "spec_helper" -describe Celluloid::IO::UNIXServer do +RSpec.describe Celluloid::IO::UNIXServer, library: :IO do let(:example_port) { assign_port } describe "#accept" do + let(:payload) { "ohai" } - let(:payload) { 'ohai' } - context "inside Celluloid::IO" do it "should be evented" do with_unix_server do |subject| expect(within_io_actor { Celluloid::IO.evented? }).to be_truthy end end it "accepts a connection and returns a Celluloid::IO::UNIXSocket" do - pending if RUBY_PLATFORM == 'java' + pending if RUBY_PLATFORM == "java" with_unix_server do |subject| thread = Thread.new { UNIXSocket.new(example_unix_sock) } peer = within_io_actor { subject.accept } expect(peer).to be_a Celluloid::IO::UNIXSocket @@ -28,13 +27,13 @@ end it "raises if server already up" do with_unix_server do |subject| within_io_actor do - expect { + expect do Celluloid::IO::UNIXServer.open(example_unix_sock) - }.to raise_error(Errno::EADDRINUSE) + end.to raise_error(Errno::EADDRINUSE) end end end context "outside Celluloid::IO" do @@ -56,15 +55,14 @@ end end it "raises if server already up" do with_unix_server do |subject| - expect { + expect do Celluloid::IO::UNIXServer.open(example_unix_sock) - }.to raise_error(Errno::EADDRINUSE) + end.to raise_error(Errno::EADDRINUSE) end end - end end end end