spec/port_explorer_spec.rb in rest-assured-2.0.0 vs spec/port_explorer_spec.rb in rest-assured-2.0.1
- old
+ new
@@ -3,11 +3,11 @@
module RestAssured::Utils
describe PortExplorer do
it 'finds free tcp port' do
free_port = PortExplorer.free_port
- lambda { Net::HTTP.get('127.0.0.1', '/', free_port) }.should raise_error(Errno::ECONNREFUSED)
+ expect { Net::HTTP.get('127.0.0.1', '/', free_port) }.to raise_error(Errno::ECONNREFUSED)
end
it 'knows if port is in use' do
port = PortExplorer.free_port
@@ -18,15 +18,15 @@
s.close
end
end
sleep 0.5
- PortExplorer.port_free?(port).should == false
+ expect(PortExplorer.port_free?(port)).to eq(false)
end
it 'knows that port is free' do
port = PortExplorer.free_port
- PortExplorer.port_free?(port).should == true
+ expect(PortExplorer.port_free?(port)).to eq(true)
end
end
end