Skip to content

Instantly share code, notes, and snippets.

@juliend2
Created January 11, 2011 18:52
Show Gist options
  • Save juliend2/774905 to your computer and use it in GitHub Desktop.
Save juliend2/774905 to your computer and use it in GitHub Desktop.
video info spec with VCR
# at the end of video_info_spec.rb ...
context "vcr recorded request" do
use_vcr_cassette "fixtures/vcr_cassettes/youtube_recorded", :record => :new_episodes
it "should have no views to it" do
video = VideoInfo.new('http://www.youtube.com/watch?v=oQ49W_xKzKA')
video.view_count.should == 0
end
end
# spec_helper.rb ...
require 'rubygems'
require 'rspec'
require 'video_info'
require 'vcr'
RSpec.configure do |config|
config.extend VCR::RSpec::Macros
# config.before(:each) do
# VCR::Config.stub_with :webmock
# end
config.color_enabled = true
config.filter_run :focus => true
config.run_all_when_everything_filtered = true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment