Permalink
Browse files

Remove #retruning for #tap

  • Loading branch information...
1 parent bdbd712 commit 71ccd9b3733b0f47384618a1b673c755b45e127a @ianwhite committed Mar 14, 2011
Showing with 5 additions and 9 deletions.
  1. +3 −3 spec/pickle/adapter_spec.rb
  2. +2 −6 spec/pickle/session_spec.rb
@@ -39,9 +39,9 @@
describe "adapters: " do
before do
- @klass1 = returning(Class.new(ActiveRecord::Base)) { |k| k.stub!(:name).and_return('One') }
- @klass2 = returning(Class.new(ActiveRecord::Base)) { |k| k.stub!(:name).and_return('One::Two') }
- @klass3 = returning(Class.new(ActiveRecord::Base)) { |k| k.stub!(:name).and_return('Three') }
+ @klass1 = Class.new(ActiveRecord::Base).tap { |k| k.stub!(:name).and_return('One') }
+ @klass2 = Class.new(ActiveRecord::Base).tap { |k| k.stub!(:name).and_return('One::Two') }
+ @klass3 = Class.new(ActiveRecord::Base).tap { |k| k.stub!(:name).and_return('Three') }
end
describe 'ActiveRecord' do
@@ -51,9 +51,7 @@ class Model
describe "extending Pickle::Session" do
subject do
- returning Object.new do |object|
- object.extend Pickle::Session
- end
+ Object.new.tap {|object| object.extend Pickle::Session }
end
it_should_behave_like "Pickle::Session proxy missing methods to parser"
@@ -80,9 +78,7 @@ class Model
describe "(found from db)" do
let :user_from_db do
- returning user.dup do |from_db|
- from_db.stub!(:id).and_return(100)
- end
+ user.dup.tap {|from_db| from_db.stub!(:id).and_return(100) }
end
before do

0 comments on commit 71ccd9b

Please sign in to comment.