[rubygem-stomp] Remove deprecate warnings

stevetraylen stevetraylen at fedoraproject.org
Mon Mar 23 11:53:48 UTC 2015


commit edac073a075ab3767661c377185008d08976f6ef
Author: Steve Traylen <steve.traylen at cern.ch>
Date:   Mon Mar 23 12:53:38 2015 +0100

    Remove deprecate warnings

 rubygem-stomp.spec               |  7 ++++-
 stomp-1.3.4-stub-deprecate.patch | 68 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 74 insertions(+), 1 deletion(-)
---
diff --git a/rubygem-stomp.spec b/rubygem-stomp.spec
index 7f9b635..086a556 100644
--- a/rubygem-stomp.spec
+++ b/rubygem-stomp.spec
@@ -8,6 +8,7 @@ Group: Development/Languages
 License: ASL 2.0
 URL: http://stomp.codehaus.org/
 Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem
+Patch0: stomp-1.3.4-stub-deprecate.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 %if 0%{?fc19} || 0%{?fc20} || 0%{?el7}
 Requires: ruby(release)
@@ -35,12 +36,16 @@ This package contains documentation for %{name}.
 gem unpack %{SOURCE0}
 
 %setup -q -D -T -n  %{gem_name}-%{version}
+%patch0 -p1
 
 gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
 
 %build
 gem build %{gem_name}.gemspec
 
+# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
+# by default, so that we can move it into the buildroot in %%install
+%gem_install
 
 %install
 mkdir -p %{buildroot}%{gem_dir}
@@ -61,7 +66,7 @@ rm -rf %{buildroot}
 %check
 pushd %{buildroot}/%{gem_instdir}
 # This part require rspec2, and it's not there yet
-rspec spec
+rspec -Ilib spec
 # Rake test requires a stomp server
 # rake test
 popd
diff --git a/stomp-1.3.4-stub-deprecate.patch b/stomp-1.3.4-stub-deprecate.patch
new file mode 100644
index 0000000..8f9b169
--- /dev/null
+++ b/stomp-1.3.4-stub-deprecate.patch
@@ -0,0 +1,68 @@
+diff -uNr stomp-1.3.4.ORIG/spec/client_shared_examples.rb stomp-1.3.4/spec/client_shared_examples.rb
+--- stomp-1.3.4.ORIG/spec/client_shared_examples.rb	2015-03-23 12:38:22.149103790 +0100
++++ stomp-1.3.4/spec/client_shared_examples.rb	2015-03-23 12:45:18.782626166 +0100
+@@ -11,24 +11,24 @@
+ 
+   describe "the closed? method" do
+     it "should be false when the connection is open" do
+-      @mock_connection.stub!(:closed?).and_return(false)
++      @mock_connection.stub(:closed?).and_return(false)
+       @client.closed?.should == false
+     end
+ 
+     it "should be true when the connection is closed" do
+-      @mock_connection.stub!(:closed?).and_return(true)
++      @mock_connection.stub(:closed?).and_return(true)
+       @client.closed?.should == true
+     end
+   end
+ 
+   describe "the open? method" do
+     it "should be true when the connection is open" do
+-      @mock_connection.stub!(:open?).and_return(true)
++      @mock_connection.stub(:open?).and_return(true)
+       @client.open?.should == true
+     end
+ 
+     it "should be false when the connection is closed" do
+-      @mock_connection.stub!(:open?).and_return(false)
++      @mock_connection.stub(:open?).and_return(false)
+       @client.open?.should == false
+     end
+   end
+@@ -36,7 +36,7 @@
+   describe "the subscribe method" do
+ 
+     before(:each) do
+-      @mock_connection.stub!(:subscribe).and_return(true)
++      @mock_connection.stub(:subscribe).and_return(true)
+     end
+ 
+     it "should raise RuntimeError if not passed a block" do
+diff -uNr stomp-1.3.4.ORIG/spec/connection_spec.rb stomp-1.3.4/spec/connection_spec.rb
+--- stomp-1.3.4.ORIG/spec/connection_spec.rb	2015-03-23 12:38:22.149103790 +0100
++++ stomp-1.3.4/spec/connection_spec.rb	2015-03-23 12:44:09.637536123 +0100
+@@ -43,8 +43,8 @@
+     # clone() does a shallow copy, we want a deep one so we can garantee the hosts order
+     normal_parameters = Marshal::load(Marshal::dump(@parameters))
+ 
+-    @tcp_socket = mock(:tcp_socket, :close => nil, :puts => nil, :write => nil, :setsockopt => nil, :flush => true)
+-    TCPSocket.stub!(:open).and_return @tcp_socket
++    @tcp_socket = double(:tcp_socket, :close => nil, :puts => nil, :write => nil, :setsockopt => nil, :flush => true)
++    TCPSocket.stub(:open).and_return @tcp_socket
+     @connection = Stomp::Connection.new(normal_parameters)
+   end
+ 
+@@ -284,9 +284,9 @@
+       
+       before(:each) do
+         ssl_parameters = {:hosts => [{:login => "login2", :passcode => "passcode2", :host => "remotehost", :ssl => true}]}
+-        @ssl_socket = mock(:ssl_socket, :puts => nil, :write => nil, 
++        @ssl_socket = double(:ssl_socket, :puts => nil, :write => nil, 
+           :setsockopt => nil, :flush => true)
+-        @ssl_socket.stub!(:sync_close=)
++        @ssl_socket.stub(:sync_close=)
+         
+         TCPSocket.should_receive(:open).and_return @tcp_socket
+         OpenSSL::SSL::SSLSocket.should_receive(:new).and_return(@ssl_socket)
+


More information about the scm-commits mailing list