You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by as...@apache.org on 2008/09/30 02:34:36 UTC

svn commit: r700315 - in /incubator/buildr/trunk: buildr.gemspec lib/buildr.rb spec/core/transport_spec.rb

Author: assaf
Date: Mon Sep 29 17:34:36 2008
New Revision: 700315

URL: http://svn.apache.org/viewvc?rev=700315&view=rev
Log:
Fixed to test with RSpec 1.1.5.

Modified:
    incubator/buildr/trunk/buildr.gemspec
    incubator/buildr/trunk/lib/buildr.rb
    incubator/buildr/trunk/spec/core/transport_spec.rb

Modified: incubator/buildr/trunk/buildr.gemspec
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/buildr.gemspec?rev=700315&r1=700314&r2=700315&view=diff
==============================================================================
--- incubator/buildr/trunk/buildr.gemspec (original)
+++ incubator/buildr/trunk/buildr.gemspec Mon Sep 29 17:34:36 2008
@@ -51,7 +51,7 @@
   spec.add_dependency 'hoe',                  '1.7.0'
   spec.add_dependency 'rjb',                  '1.1.6' if spec.platform.to_s == 'ruby' 
   spec.add_dependency 'Antwrap',              '0.7.0'
-  spec.add_dependency 'rspec',                '1.1.4'
+  spec.add_dependency 'rspec',                '1.1.5'
   spec.add_dependency 'xml-simple',           '1.0.11'
   spec.add_dependency 'archive-tar-minitar',  '0.5.2'
   spec.add_dependency 'jruby-openssl',        '0.2'   if spec.platform.to_s == 'java'

Modified: incubator/buildr/trunk/lib/buildr.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/buildr.rb?rev=700315&r1=700314&r2=700315&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/buildr.rb (original)
+++ incubator/buildr/trunk/lib/buildr.rb Mon Sep 29 17:34:36 2008
@@ -32,5 +32,4 @@
 end
 
 # Prevent RSpec runner from running at_exit.
-require 'spec'
-Spec.run = true
+require 'spec'
\ No newline at end of file

Modified: incubator/buildr/trunk/spec/core/transport_spec.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/core/transport_spec.rb?rev=700315&r1=700314&r2=700315&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/core/transport_spec.rb (original)
+++ incubator/buildr/trunk/spec/core/transport_spec.rb Mon Sep 29 17:34:36 2008
@@ -373,16 +373,12 @@
   end
 
   it 'should fail on 4xx response' do
-    @http.should_receive(:request) do |request|
-      Net::HTTPBadRequest.new(nil, nil, nil)
-    end
+    @http.should_receive(:request).and_return(Net::HTTPBadRequest.new(nil, nil, nil))
     lambda { @uri.write @content }.should raise_error(RuntimeError, /failed to upload/i)
   end
 
   it 'should fail on 5xx response' do
-    @http.should_receive(:request) do |request|
-      Net::HTTPServiceUnavailable.new(nil, nil, nil)
-    end
+    @http.should_receive(:request).and_return(Net::HTTPServiceUnavailable.new(nil, nil, nil))
     lambda { @uri.write @content }.should raise_error(RuntimeError, /failed to upload/i)
   end
 
@@ -397,7 +393,7 @@
     @ssh_session = mock('Net::SSH::Session')
     @sftp_session = mock('Net::SFTP::Session')
     @file_factory = mock('Net::SFTP::Operations::FileFactory')
-    Net::SSH.stub!(:start).with('localhost', 'john', :password=>'secret', :port=>22) do
+    Net::SSH.stub!(:start).with('localhost', 'john', :password=>'secret', :port=>22).and_return(@ssh_session) do
       Net::SFTP::Session.should_receive(:new).with(@ssh_session).and_yield(@sftp_session).and_return(@sftp_session)
       @sftp_session.should_receive(:connect!).and_return(@sftp_session)
       @sftp_session.should_receive(:loop)
@@ -445,7 +441,7 @@
     @ssh_session = mock('Net::SSH::Session')
     @sftp_session = mock('Net::SFTP::Session')
     @file_factory = mock('Net::SFTP::Operations::FileFactory')
-    Net::SSH.stub!(:start).with('localhost', 'john', :password=>'secret', :port=>22) do
+    Net::SSH.stub!(:start).with('localhost', 'john', :password=>'secret', :port=>22).and_return(@ssh_session) do
       Net::SFTP::Session.should_receive(:new).with(@ssh_session).and_yield(@sftp_session).and_return(@sftp_session)
       @sftp_session.should_receive(:connect!).and_return(@sftp_session)
       @sftp_session.should_receive(:loop)