Permalink
Browse files

refactored 'bosdk_spec.rb'

  • Loading branch information...
1 parent 363b258 commit 28264eb7e70c7ff4661b073d5488551aa4fc1b30 @semmons99 committed Feb 9, 2010
Showing with 7 additions and 5 deletions.
  1. +7 −5 spec/bosdk_spec.rb
View
@@ -4,14 +4,16 @@
module BOSDK
describe BOSDK do
describe "#connect" do
- specify "wraps EnterpriseSession#new in a closure" do
- es = mock("EnterpriseSession").as_null_object
+ before(:each) do
+ @es = mock("EnterpriseSession").as_null_object
class EnterpriseSession; end
- EnterpriseSession.should_receive(:new).once.with('cms', 'Administrator', '', {:locale => "en_US"}).and_return(es)
- es.should_receive(:disconnect).once.with.and_return
+ EnterpriseSession.should_receive(:new).once.with('cms', 'Administrator', '', {:locale => "en_US"}).and_return(@es)
+ @es.should_receive(:disconnect).once.with.and_return
+ end
+ specify "wraps EnterpriseSession#new in a closure" do
BOSDK.connect('cms', 'Administrator', '', :locale => "en_US") do |session|
- session.should == es
+ session.should == @es
end
end
end

0 comments on commit 28264eb

Please sign in to comment.