[DRE-commits] [ruby-em-proxy] 01/01: corrected deprecation warnings
Philippe Thierry
pthierry-guest at moszumanska.debian.org
Thu Sep 7 19:54:42 UTC 2017
This is an automated email from the git hooks/post-receive script.
pthierry-guest pushed a commit to branch master
in repository ruby-em-proxy.
commit c71258d2edcdee761e82702d12028ca2b71e9b6d
Author: Philippe Thierry <phil at reseau-libre.net>
Date: Thu Sep 7 21:34:40 2017 +0200
corrected deprecation warnings
---
debian/patches/deprecation_warn.patch | 79 +++++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 80 insertions(+)
diff --git a/debian/patches/deprecation_warn.patch b/debian/patches/deprecation_warn.patch
new file mode 100644
index 0000000..d982400
--- /dev/null
+++ b/debian/patches/deprecation_warn.patch
@@ -0,0 +1,79 @@
+Description: Correct ruby deprecation warning
+ Replace the usage of should in rspec by expect.
+ Should is keeped only when expect is unuseable.
+Author: Philippe Thierry
+Last-Update: 2017-09-07
+--- a/spec/balancing_spec.rb
++++ b/spec/balancing_spec.rb
+@@ -22,7 +22,7 @@
+ context "generally" do
+
+ it "should raise error for unknown strategy" do
+- lambda { BalancingProxy::Backend.select(:asdf)}.should raise_error(ArgumentError)
++ expect(lambda { BalancingProxy::Backend.select(:asdf)}).to raise_error(ArgumentError)
+ end
+
+ end
+@@ -41,7 +41,7 @@
+ end
+
+ srand(0)
+- BalancingProxy::Backend.select(:random).host.should == '127.0.0.1'
++ expect(BalancingProxy::Backend.select(:random).host).to be == '127.0.0.1'
+ end
+
+ end
+@@ -58,10 +58,10 @@
+ end
+ end
+
+- BalancingProxy::Backend.select(:roundrobin).host.should == '127.0.0.1'
+- BalancingProxy::Backend.select(:roundrobin).host.should == '127.0.0.2'
+- BalancingProxy::Backend.select(:roundrobin).host.should == '127.0.0.3'
+- BalancingProxy::Backend.select(:roundrobin).host.should == '127.0.0.1'
++ expect(BalancingProxy::Backend.select(:roundrobin).host).to be == '127.0.0.1'
++ expect(BalancingProxy::Backend.select(:roundrobin).host).to be == '127.0.0.2'
++ expect(BalancingProxy::Backend.select(:roundrobin).host).to be == '127.0.0.3'
++ expect(BalancingProxy::Backend.select(:roundrobin).host).to be == '127.0.0.1'
+ end
+ end
+
+@@ -78,7 +78,7 @@
+ end
+ end
+
+- BalancingProxy::Backend.select.host.should == '127.0.0.3'
++ expect(BalancingProxy::Backend.select.host).to be == '127.0.0.3'
+ end
+
+ it "should select the least loaded backend" do
+@@ -92,10 +92,10 @@
+ end
+ end
+
+- BalancingProxy::Backend.select.host.should == '127.0.0.1'
+- BalancingProxy::Backend.select.host.should == '127.0.0.1'
+- BalancingProxy::Backend.select.host.should_not == '127.0.0.3'
+- BalancingProxy::Backend.select.host.should_not == '127.0.0.3'
++ expect(BalancingProxy::Backend.select.host).to be == '127.0.0.1'
++ expect(BalancingProxy::Backend.select.host).to be == '127.0.0.1'
++ expect(BalancingProxy::Backend.select.host).not_to be == '127.0.0.3'
++ expect(BalancingProxy::Backend.select.host).not_to be == '127.0.0.3'
+ end
+
+ end
+--- a/spec/proxy_spec.rb
++++ b/spec/proxy_spec.rb
+@@ -1,5 +1,12 @@
+ require 'helper'
+
++RSpec.configure do |config|
++ config.expect_with :rspec do |c|
++ # allowing both should and expect as expect doesn't support =~
++ c.syntax = [:should, :expect]
++ end
++end
++
+ describe Proxy do
+ include POSIX::Spawn
+
diff --git a/debian/patches/series b/debian/patches/series
index e631e66..d479256 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
+deprecation_warn.patch
failing_tests.patch
updated-deps-version.patch
drop-git-ls-files.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-em-proxy.git
More information about the Pkg-ruby-extras-commits
mailing list