Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save voxik/1405072 to your computer and use it in GitHub Desktop.
Save voxik/1405072 to your computer and use it in GitHub Desktop.
From 0cb6a9821a15ff16b414bd49c3ffbfef653af336 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
Date: Tue, 29 Nov 2011 15:53:24 +0100
Subject: [PATCH] Use as_null_object to be RSpec2 compatible
---
spec/backends/swiftiply_client_spec.rb | 4 ++--
spec/connection_spec.rb | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/spec/backends/swiftiply_client_spec.rb b/spec/backends/swiftiply_client_spec.rb
index a5693b0..036a6a8 100644
--- a/spec/backends/swiftiply_client_spec.rb
+++ b/spec/backends/swiftiply_client_spec.rb
@@ -3,7 +3,7 @@ require 'spec_helper'
describe Backends::SwiftiplyClient do
before do
@backend = Backends::SwiftiplyClient.new('0.0.0.0', 3333)
- @backend.server = mock('server', :null_object => true)
+ @backend.server = mock('server').as_null_object
end
it "should connect" do
@@ -26,7 +26,7 @@ describe SwiftiplyConnection do
before do
@connection = SwiftiplyConnection.new(nil)
@connection.backend = Backends::SwiftiplyClient.new('0.0.0.0', 3333)
- @connection.backend.server = mock('server', :null_object => true)
+ @connection.backend.server = mock('server').as_null_object
end
it do
diff --git a/spec/connection_spec.rb b/spec/connection_spec.rb
index 9035615..b043937 100644
--- a/spec/connection_spec.rb
+++ b/spec/connection_spec.rb
@@ -2,7 +2,7 @@ require 'spec_helper'
describe Connection do
before do
- @connection = Connection.new(mock('EM', :null_object => true))
+ @connection = Connection.new(mock('EM').as_null_object)
@connection.post_init
@connection.backend = mock("backend", :ssl? => false)
@connection.app = proc do |env|
--
1.7.7.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment