Permalink
Browse files

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

  • Loading branch information...
1 parent 83da2fb commit 8e6bf19b5f1694aee98ed4b83c14081fa07f0883 @lukeredpath lukeredpath committed Mar 5, 2012
Showing with 26 additions and 5 deletions.
  1. +2 −1 .gitignore
  2. +2 −0 Gemfile
  3. +8 −0 Gemfile.lock
  4. +6 −4 spec/functional/downloader_spec.rb
  5. +8 −0 spec/spec_helper.rb
View
@@ -15,4 +15,5 @@ spec/fixtures/integration/Headers/
pod
/concatenated.*
spec/fixtures/mercurial-repo/.hg/*cache
-.hg
+.hg
+spec/fixtures/vcr
View
@@ -8,4 +8,6 @@ group :development do
gem "rb-fsevent"
gem "growl"
gem "mocha-on-bacon"
+ gem "vcr"
+ gem "webmock"
end
View
@@ -1,7 +1,9 @@
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 @@
: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 @@
: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 @@
: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
View
@@ -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

0 comments on commit 8e6bf19

Please sign in to comment.