2014-09-01 45 views

回答

3

RSpec的配置,使configure_rspec_metadata!將使automatic cassette naming

require 'vcr' 

VCR.configure do |c| 
    c.cassette_library_dir = 'spec/cassettes' 
    c.hook_into :fakeweb 
    c.configure_rspec_metadata! 
end 

RSpec.configure do |c| 
    # so we can use :vcr rather than :vcr => true; 
    # in RSpec 3 this will no longer be necessary. 
    c.treat_symbols_as_metadata_keys_with_true_values = true 
end