Browse Source

Add VCR support, for more complex mocking.

Daniel O'Connor 10 years ago
parent
commit
46606455c1
3 changed files with 13 additions and 0 deletions
  1. 2 0
      Gemfile
  2. 2 0
      Gemfile.lock
  3. 9 0
      spec/support/vcr_support.rb

+ 2 - 0
Gemfile

@@ -78,6 +78,8 @@ gem 'therubyracer', '~> 0.12.1'
 
 gem 'mqtt'
 
+gem 'vcr'
+
 group :development do
   gem 'binding_of_caller'
   gem 'better_errors'

+ 2 - 0
Gemfile.lock

@@ -319,6 +319,7 @@ GEM
     uuid (2.3.7)
       macaddr (~> 1.0)
     uuidtools (2.1.4)
+    vcr (2.9.2)
     warden (1.2.3)
       rack (>= 1.0)
     webmock (1.17.4)
@@ -392,6 +393,7 @@ DEPENDENCIES
   typhoeus (~> 0.6.3)
   tzinfo-data
   uglifier (>= 1.3.0)
+  vcr
   webmock
   weibo_2 (~> 0.1.4)
   wunderground (~> 1.2.0)

+ 9 - 0
spec/support/vcr_support.rb

@@ -0,0 +1,9 @@
+require 'vcr'
+
+VCR.configure do |c|
+  c.cassette_library_dir = 'spec/cassettes'
+  c.allow_http_connections_when_no_cassette = true
+  c.hook_into :webmock
+  c.default_cassette_options = { record: :new_episodes}
+  c.configure_rspec_metadata!
+end