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

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

parent 83da2fba
...@@ -16,3 +16,4 @@ pod ...@@ -16,3 +16,4 @@ pod
/concatenated.* /concatenated.*
spec/fixtures/mercurial-repo/.hg/*cache spec/fixtures/mercurial-repo/.hg/*cache
.hg .hg
spec/fixtures/vcr
...@@ -8,4 +8,6 @@ group :development do ...@@ -8,4 +8,6 @@ group :development do
gem "rb-fsevent" gem "rb-fsevent"
gem "growl" gem "growl"
gem "mocha-on-bacon" gem "mocha-on-bacon"
gem "vcr"
gem "webmock"
end end
GEM GEM
remote: http://rubygems.org/ remote: http://rubygems.org/
specs: specs:
addressable (2.2.7)
bacon (1.1.0) bacon (1.1.0)
crack (0.3.1)
growl (1.0.3) growl (1.0.3)
guard (0.8.8) guard (0.8.8)
thor (~> 0.14.6) thor (~> 0.14.6)
...@@ -15,6 +17,10 @@ GEM ...@@ -15,6 +17,10 @@ GEM
rake (0.9.2.2) rake (0.9.2.2)
rb-fsevent (0.9.0) rb-fsevent (0.9.0)
thor (0.14.6) thor (0.14.6)
vcr (2.0.0)
webmock (1.8.0)
addressable (>= 2.2.7)
crack (>= 0.1.7)
PLATFORMS PLATFORMS
ruby ruby
...@@ -27,3 +33,5 @@ DEPENDENCIES ...@@ -27,3 +33,5 @@ DEPENDENCIES
mocha-on-bacon mocha-on-bacon
rake rake
rb-fsevent rb-fsevent
vcr
webmock
...@@ -46,7 +46,8 @@ describe "Pod::Downloader" do ...@@ -46,7 +46,8 @@ describe "Pod::Downloader" do
:git => "git://github.com/lukeredpath/libPusher.git", :download_only => true :git => "git://github.com/lukeredpath/libPusher.git", :download_only => true
) )
downloader = Pod::Downloader.for_pod(@pod) 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 # deliberately keep this assertion as loose as possible for now
(@pod.root + 'README.md').readlines[0].should =~ /libPusher/ (@pod.root + 'README.md').readlines[0].should =~ /libPusher/
...@@ -57,7 +58,8 @@ describe "Pod::Downloader" do ...@@ -57,7 +58,8 @@ describe "Pod::Downloader" do
:git => "git://github.com/lukeredpath/libPusher.git", :tag => 'v1.1', :download_only => true :git => "git://github.com/lukeredpath/libPusher.git", :tag => 'v1.1', :download_only => true
) )
downloader = Pod::Downloader.for_pod(@pod) 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 # deliberately keep this assertion as loose as possible for now
(@pod.root + 'libPusher.podspec').readlines.grep(/1.1/).should.not.be.empty (@pod.root + 'libPusher.podspec').readlines.grep(/1.1/).should.not.be.empty
...@@ -68,12 +70,12 @@ describe "Pod::Downloader" do ...@@ -68,12 +70,12 @@ describe "Pod::Downloader" do
:git => "git://github.com/lukeredpath/libPusher.git", :commit => 'eca89998d5', :download_only => true :git => "git://github.com/lukeredpath/libPusher.git", :commit => 'eca89998d5', :download_only => true
) )
downloader = Pod::Downloader.for_pod(@pod) 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 # deliberately keep this assertion as loose as possible for now
(@pod.root + 'README.md').readlines[0].should =~ /PusherTouch/ (@pod.root + 'README.md').readlines[0].should =~ /PusherTouch/
end end
end end
describe "for Mercurial" do describe "for Mercurial" do
......
...@@ -49,3 +49,11 @@ def copy_fixture_to_pod(name, pod) ...@@ -49,3 +49,11 @@ def copy_fixture_to_pod(name, pod)
end end
SpecHelper::Fixture.fixture('banana-lib') # ensure it exists 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