Commit 8e6bf19b authored by Luke Redpath's avatar Luke Redpath

Use VCR to record tarball downloads and speed up subsequent spec runs.

parent 83da2fba
......@@ -15,4 +15,5 @@ spec/fixtures/integration/Headers/
pod
/concatenated.*
spec/fixtures/mercurial-repo/.hg/*cache
.hg
\ No newline at end of file
.hg
spec/fixtures/vcr
......@@ -8,4 +8,6 @@ group :development do
gem "rb-fsevent"
gem "growl"
gem "mocha-on-bacon"
gem "vcr"
gem "webmock"
end
GEM
remote: http://rubygems.org/
specs:
addressable (2.2.7)
bacon (1.1.0)
crack (0.3.1)
growl (1.0.3)
guard (0.8.8)
thor (~> 0.14.6)
......@@ -15,6 +17,10 @@ GEM
rake (0.9.2.2)
rb-fsevent (0.9.0)
thor (0.14.6)
vcr (2.0.0)
webmock (1.8.0)
addressable (>= 2.2.7)
crack (>= 0.1.7)
PLATFORMS
ruby
......@@ -27,3 +33,5 @@ DEPENDENCIES
mocha-on-bacon
rake
rb-fsevent
vcr
webmock
......@@ -46,7 +46,8 @@ describe "Pod::Downloader" do
:git => "git://github.com/lukeredpath/libPusher.git", :download_only => true
)
downloader = Pod::Downloader.for_pod(@pod)
downloader.download
VCR.use_cassette('tarballs', :record => :new_episodes) { downloader.download }
# deliberately keep this assertion as loose as possible for now
(@pod.root + 'README.md').readlines[0].should =~ /libPusher/
......@@ -57,7 +58,8 @@ describe "Pod::Downloader" do
:git => "git://github.com/lukeredpath/libPusher.git", :tag => 'v1.1', :download_only => true
)
downloader = Pod::Downloader.for_pod(@pod)
downloader.download
VCR.use_cassette('tarballs', :record => :new_episodes) { downloader.download }
# deliberately keep this assertion as loose as possible for now
(@pod.root + 'libPusher.podspec').readlines.grep(/1.1/).should.not.be.empty
......@@ -68,12 +70,12 @@ describe "Pod::Downloader" do
:git => "git://github.com/lukeredpath/libPusher.git", :commit => 'eca89998d5', :download_only => true
)
downloader = Pod::Downloader.for_pod(@pod)
downloader.download
VCR.use_cassette('tarballs', :record => :new_episodes) { downloader.download }
# deliberately keep this assertion as loose as possible for now
(@pod.root + 'README.md').readlines[0].should =~ /PusherTouch/
end
end
describe "for Mercurial" do
......
......@@ -49,3 +49,11 @@ def copy_fixture_to_pod(name, pod)
end
SpecHelper::Fixture.fixture('banana-lib') # ensure it exists
require 'vcr'
require 'webmock'
VCR.configure do |c|
c.cassette_library_dir = (ROOT + 'spec/fixtures/vcr').to_s
c.hook_into :webmock # or :fakeweb
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment