File: naming.feature

package info (click to toggle)
ruby-vcr 6.0.0%2Breally5.0.0-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,320 kB
  • sloc: ruby: 8,456; sh: 177; makefile: 7
file content (28 lines) | stat: -rw-r--r-- 896 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Feature: Naming

  When inserting or using a cassette, the first argument is the cassette name.
  You can use any string for the name.  If you use the default `:file_system`
  storage backend, VCR will sanitize the string before using it as a file name,
  so that it is a file-system friendly file name.

  Scenario: Name sanitizing
    Given a file named "name_sanitizing.rb" with:
      """ruby
      $server = start_sinatra_app do
        get('/') { "Hello" }
      end

      require 'vcr'

      VCR.configure do |c|
        c.cassette_library_dir = 'cassettes'
        c.hook_into :webmock
      end

      VCR.use_cassette('Fee, Fi Fo Fum') do
        Net::HTTP.get_response('localhost', '/', $server.port)
      end
      """
     And the directory "cassettes" does not exist
    When I run `ruby name_sanitizing.rb`
    Then the file "cassettes/Fee_Fi_Fo_Fum.yml" should contain "Hello"