Skip to content

Commit

Permalink
Fixed the issue with the very slow basic auth specs.
Browse files Browse the repository at this point in the history
(2.84 seconds -> 0.05 seconds)
  • Loading branch information
peterhellberg committed Jun 21, 2012
1 parent 04f9ef8 commit 8a75154
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions spec/pinch_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,16 @@
@data = "{\"gem\":\"pinch\",\"authors\":[\"Peter Hellberg\",\"Edward Patel\"],\"github_url\":\"https://github.com/peterhellberg/pinch\"}\n"
end

VCR.use_cassette('basic_auth', :match_requests_on => [:method, :uri, :headers]) do
it "should retrieve the contents of the file data.json with valid authentication" do
it "should retrieve the contents of the file data.json with valid authentication" do
VCR.use_cassette('valid_basic_auth') do
data = Pinch.get @url, @file, 'pinch_test', 'thisisjustatest'
data.must_equal @data
data.size.must_equal 114
end

it "should not retrieve the contents of the file data.json with invalid authentication" do
end

it "should not retrieve the contents of the file data.json with invalid authentication" do
VCR.use_cassette('invalid_basic_auth') do
lambda {
Pinch.get @url, @file, 'invalid_username', 'invalid_password'
}.must_raise Net::HTTPServerException
Expand Down

0 comments on commit 8a75154

Please sign in to comment.