Skip to content

Commit

Permalink
Moved variables under nested describe blocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
bblimke committed Mar 30, 2012
1 parent 352d653 commit 129fd7d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions spec/unit/rack_response_spec.rb
Expand Up @@ -3,12 +3,6 @@
describe WebMock::RackResponse do describe WebMock::RackResponse do
before :each do before :each do
@rack_response = WebMock::RackResponse.new(MyRackApp) @rack_response = WebMock::RackResponse.new(MyRackApp)
@locked_rack_response = WebMock::RackResponse.new(MyLockedRackApp)
@rack_response_with_basic_auth = WebMock::RackResponse.new(
Rack::Auth::Basic.new(MyRackApp) do |username, password|
username == 'username' && password == 'password'
end
)
end end


it "should hook up to a rack appliance" do it "should hook up to a rack appliance" do
Expand All @@ -28,6 +22,7 @@
end end


it "should shouldn't blow up when hitting a locked resource twice" do it "should shouldn't blow up when hitting a locked resource twice" do
@locked_rack_response = WebMock::RackResponse.new(MyLockedRackApp)
request = WebMock::RequestSignature.new(:get, 'www.example.com/locked') request = WebMock::RequestSignature.new(:get, 'www.example.com/locked')
response = @locked_rack_response.evaluate(request) response = @locked_rack_response.evaluate(request)
response2 = @locked_rack_response.evaluate(request) response2 = @locked_rack_response.evaluate(request)
Expand Down Expand Up @@ -55,6 +50,13 @@
end end


describe 'basic auth request' do describe 'basic auth request' do
before :each do
@rack_response_with_basic_auth = WebMock::RackResponse.new(
Rack::Auth::Basic.new(MyRackApp) do |username, password|
username == 'username' && password == 'password'
end
)
end
it 'should be failure when wrong credentials' do it 'should be failure when wrong credentials' do
request = WebMock::RequestSignature.new(:get, 'foo:bar@www.example.com') request = WebMock::RequestSignature.new(:get, 'foo:bar@www.example.com')
response = @rack_response_with_basic_auth.evaluate(request) response = @rack_response_with_basic_auth.evaluate(request)
Expand Down

0 comments on commit 129fd7d

Please sign in to comment.