Skip to content
Browse files

Migrate call the cucumber cassettes to updated format.

The cassette format now includes the encoding of the request and response body.
  • Loading branch information...
1 parent 53d7256 commit 531acdf608f15d77833810f19afda9527653843d @myronmarston committed Feb 12, 2012
View
35 Rakefile
@@ -122,9 +122,23 @@ end
desc "Migrate cucumber cassettes"
task :migrate_cucumber_cassettes do
- sh "git checkout cb3559d6ffcb36cb823ae96a677e380e5b86ed80 -- features"
- require 'vcr/cassette/migrator'
+ require 'vcr'
+ require 'ruby-debug'
+
+ VCR.configure do |c|
+ c.cassette_library_dir = 'tmp/migrate'
+ c.default_cassette_options = { :serialize_with => :syck }
+ end
+
+ # We want 2.0.0 in the cucumber cassettes instead of 2.0.0.rc1
+ def VCR.version
+ "2.0.0"
+ end
+
Dir["features/**/*.feature"].each do |feature_file|
+ # The ERB cassettes can't be migrated automatically.
+ next if feature_file.include?('dynamic_erb')
+
puts " - Migrating #{feature_file}"
contents = File.read(feature_file)
@@ -135,15 +149,22 @@ task :migrate_cucumber_cassettes do
cassette_yml = capture.gsub(/^#{indentation}/, '')
new_yml = nil
- Dir.mktmpdir do |dir|
- file_name = "#{dir}/cassette.yml"
- File.open(file_name, 'w') { |f| f.write(cassette_yml) }
- VCR::Cassette::Migrator.new(dir, StringIO.new).migrate!
- new_yml = File.read(file_name)
+ file_name = "tmp/migrate/cassette.yml"
+ File.open(file_name, 'w') { |f| f.write(cassette_yml) }
+ cassette = VCR::Cassette.new('cassette')
+
+ hash = begin
+ cassette.serializable_hash
+ rescue => e
+ puts " Skipping #{capture[0, 80]}"
+ next
end
+ new_yml = VCR::Cassette::Serializers::Syck.serialize(hash)
+
new_yml.gsub!(/^/, indentation)
new_yml << indentation
+ new_yml.gsub!(/^\s+\n(\s+response:)/, '\1')
contents.gsub!(capture, new_yml)
end
View
26 features/cassettes/automatic_re_recording.feature
@@ -13,22 +13,26 @@ Feature: Automatic Re-recording
Background:
Given a previously recorded cassette file "cassettes/example.yml" with:
"""
- ---
- http_interactions:
- - request:
+ ---
+ http_interactions:
+ - request:
method: get
uri: http://localhost:7777/
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Length:
- - '12'
- body: Old Response
- http_version: '1.1'
+ headers:
+ Content-Length:
+ - "12"
+ body:
+ encoding: UTF-8
+ string: Old Response
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
recorded_with: VCR 2.0.0
"""
View
16 features/cassettes/dynamic_erb.feature
@@ -17,7 +17,9 @@ Feature: Dynamic ERB cassettes
- request:
method: get
uri: http://example.com/foo?a=<%= 'b' * 3 %>
- body: ''
+ body:
+ encoding: UTF-8
+ string: ''
headers: {}
response:
status:
@@ -28,7 +30,9 @@ Feature: Dynamic ERB cassettes
- text/html;charset=utf-8
Content-Length:
- '9'
- body: Hello <%= 'bar'.next %>
+ body:
+ encoding: UTF-8
+ string: Hello <%= 'bar'.next %>
http_version: '1.1'
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
recorded_with: VCR 2.0.0
@@ -58,7 +62,9 @@ Feature: Dynamic ERB cassettes
- request:
method: get
uri: http://example.com/foo?a=<%= arg1 %>
- body: ''
+ body:
+ encoding: UTF-8
+ string: ''
headers: {}
response:
status:
@@ -69,7 +75,9 @@ Feature: Dynamic ERB cassettes
- text/html;charset=utf-8
Content-Length:
- '9'
- body: Hello <%= arg2 %>
+ body:
+ encoding: UTF-8
+ string: Hello <%= arg2 %>
http_version: '1.1'
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
recorded_with: VCR 2.0.0
View
52 features/cassettes/exclusive.feature
@@ -17,43 +17,51 @@ Feature: exclusive cassette
Background:
Given a previously recorded cassette file "cassettes/outer.yml" with:
"""
- ---
- http_interactions:
- - request:
+ ---
+ http_interactions:
+ - request:
method: get
uri: http://localhost:7777/outer
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Length:
- - '18'
- body: Old outer response
- http_version: '1.1'
+ headers:
+ Content-Length:
+ - "18"
+ body:
+ encoding: UTF-8
+ string: Old outer response
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
recorded_with: VCR 2.0.0
"""
And a previously recorded cassette file "cassettes/inner.yml" with:
"""
- ---
- http_interactions:
- - request:
+ ---
+ http_interactions:
+ - request:
method: get
uri: http://localhost:7777/inner
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Length:
- - '18'
- body: Old inner response
- http_version: '1.1'
+ headers:
+ Content-Length:
+ - "18"
+ body:
+ encoding: UTF-8
+ string: Old inner response
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
recorded_with: VCR 2.0.0
"""
View
84 features/cassettes/format.feature
@@ -9,13 +9,17 @@ Feature: Cassette format
- method
- uri
- body
+ - encoding
+ - string
- headers
- response
- status
- code
- message
- headers
- body
+ - encoding
+ - string
- http version
By default, VCR uses YAML to serialize this data. You can configure
@@ -72,41 +76,49 @@ Feature: Cassette format
When I run `ruby cassette_yaml.rb 'Hello'`
Then the file "cassettes/example.yml" should contain YAML like:
"""
- ---
- http_interactions:
- - request:
+ ---
+ http_interactions:
+ - request:
method: get
uri: http://localhost:7777/foo
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Type:
+ headers:
+ Content-Type:
- text/html;charset=utf-8
- Content-Length:
- - '9'
- body: Hello foo
- http_version: '1.1'
+ Content-Length:
+ - "9"
+ body:
+ encoding: UTF-8
+ string: Hello foo
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
- - request:
+ - request:
method: get
uri: http://localhost:7777/bar
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Type:
+ headers:
+ Content-Type:
- text/html;charset=utf-8
- Content-Length:
- - '9'
- body: Hello bar
- http_version: '1.1'
+ Content-Length:
+ - "9"
+ body:
+ encoding: UTF-8
+ string: Hello bar
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
recorded_with: VCR 2.0.0
"""
@@ -152,7 +164,10 @@ Feature: Cassette format
"http_interactions": [
{
"response": {
- "body": "Hello foo",
+ "body": {
+ "encoding": "UTF-8",
+ "string": "Hello foo"
+ },
"http_version": null,
"status": { "code": 200, "message": "OK" },
"headers": {
@@ -165,15 +180,21 @@ Feature: Cassette format
},
"request": {
"uri": "http://localhost:7777/foo",
- "body": "",
+ "body": {
+ "encoding": "UTF-8",
+ "string": ""
+ },
"method": "get",
"headers": { }
},
"recorded_at": "Tue, 01 Nov 2011 04:58:44 GMT"
},
{
"response": {
- "body": "Hello bar",
+ "body": {
+ "encoding": "UTF-8",
+ "string": "Hello bar"
+ },
"http_version": null,
"status": { "code": 200, "message": "OK" },
"headers": {
@@ -186,7 +207,10 @@ Feature: Cassette format
},
"request": {
"uri": "http://localhost:7777/bar",
- "body": "",
+ "body": {
+ "encoding": "UTF-8",
+ "string": ""
+ },
"method": "get",
"headers": { }
},
@@ -241,29 +265,29 @@ Feature: Cassette format
[{"request"=>
{"method"=>"get",
"uri"=>"http://localhost:7777/foo",
- "body"=>"",
+ "body"=>{"encoding"=>"UTF-8", "string"=>""},
"headers"=>{"Accept"=>["*/*"], "User-Agent"=>["Ruby"]}},
"response"=>
{"status"=>{"code"=>200, "message"=>"OK "},
"headers"=>
{"Content-Type"=>["text/html;charset=utf-8"],
"Content-Length"=>["9"],
"Connection"=>["Keep-Alive"]},
- "body"=>"Hello foo",
+ "body"=>{"encoding"=>"UTF-8", "string"=>"Hello foo"},
"http_version"=>nil},
"recorded_at"=>"Tue, 01 Nov 2011 04:58:44 GMT"},
{"request"=>
{"method"=>"get",
"uri"=>"http://localhost:7777/bar",
- "body"=>"",
+ "body"=>{"encoding"=>"UTF-8", "string"=>""},
"headers"=>{"Accept"=>["*/*"], "User-Agent"=>["Ruby"]}},
"response"=>
{"status"=>{"code"=>200, "message"=>"OK "},
"headers"=>
{"Content-Type"=>["text/html;charset=utf-8"],
"Content-Length"=>["9"],
"Connection"=>["Keep-Alive"]},
- "body"=>"Hello bar",
+ "body"=>{"encoding"=>"UTF-8", "string"=>"Hello bar"},
"http_version"=>nil},
"recorded_at"=>"Tue, 01 Nov 2011 04:58:44 GMT"}],
"recorded_with"=>"VCR 2.0.0"}
View
28 features/cassettes/update_content_length_header.feature
@@ -21,24 +21,28 @@ Feature: Update content_length header
Background:
Given a previously recorded cassette file "cassettes/example.yml" with:
"""
- ---
- http_interactions:
- - request:
+ ---
+ http_interactions:
+ - request:
method: get
uri: http://example.com/
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Type:
+ headers:
+ Content-Type:
- text/html;charset=utf-8
- Content-Length:
- - '11'
- body: Hello <modified>
- http_version: '1.1'
+ Content-Length:
+ - "11"
+ body:
+ encoding: UTF-8
+ string: Hello <modified>
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
recorded_with: VCR 2.0.0
"""
View
28 features/hooks/before_playback.feature
@@ -26,24 +26,28 @@ Feature: before_playback hook
Background:
Given a previously recorded cassette file "cassettes/example.yml" with:
"""
- ---
- http_interactions:
- - request:
+ ---
+ http_interactions:
+ - request:
method: get
uri: http://localhost:7777/
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Type:
+ headers:
+ Content-Type:
- text/html;charset=utf-8
- Content-Length:
- - '20'
- body: previously recorded response
- http_version: '1.1'
+ Content-Length:
+ - "20"
+ body:
+ encoding: UTF-8
+ string: previously recorded response
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
recorded_with: VCR 2.0.0
"""
View
140 features/http_libraries/em_http_request.feature
@@ -59,57 +59,69 @@ Feature: EM HTTP Request
"""
And the file "cassettes/em_http.yml" should contain YAML like:
"""
- ---
- http_interactions:
- - request:
+ ---
+ http_interactions:
+ - request:
method: get
uri: http://localhost:7777/foo
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Type:
+ headers:
+ Content-Type:
- text/html;charset=utf-8
- Content-Length:
- - '9'
- body: Hello foo
+ Content-Length:
+ - "9"
+ body:
+ encoding: UTF-8
+ string: Hello foo
http_version:
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
- - request:
+ - request:
method: get
uri: http://localhost:7777/bar
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Type:
+ headers:
+ Content-Type:
- text/html;charset=utf-8
- Content-Length:
- - '9'
- body: Hello bar
+ Content-Length:
+ - "9"
+ body:
+ encoding: UTF-8
+ string: Hello bar
http_version:
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
- - request:
+ - request:
method: get
uri: http://localhost:7777/bazz
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Type:
+ headers:
+ Content-Type:
- text/html;charset=utf-8
- Content-Length:
- - '10'
- body: Hello bazz
+ Content-Length:
+ - "10"
+ body:
+ encoding: UTF-8
+ string: Hello bazz
http_version:
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
recorded_with: VCR 2.0.0
@@ -154,57 +166,69 @@ Feature: EM HTTP Request
"""
And the file "cassettes/em_http.yml" should contain YAML like:
"""
- ---
- http_interactions:
- - request:
+ ---
+ http_interactions:
+ - request:
method: get
uri: http://localhost:7777/foo
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Type:
+ headers:
+ Content-Type:
- text/html;charset=utf-8
- Content-Length:
- - '9'
- body: Hello foo
+ Content-Length:
+ - "9"
+ body:
+ encoding: UTF-8
+ string: Hello foo
http_version:
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
- - request:
+ - request:
method: get
uri: http://localhost:7777/bar
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Type:
+ headers:
+ Content-Type:
- text/html;charset=utf-8
- Content-Length:
- - '9'
- body: Hello bar
+ Content-Length:
+ - "9"
+ body:
+ encoding: UTF-8
+ string: Hello bar
http_version:
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
- - request:
+ - request:
method: get
uri: http://localhost:7777/bazz
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Type:
+ headers:
+ Content-Type:
- text/html;charset=utf-8
- Content-Length:
- - '10'
- body: Hello bazz
+ Content-Length:
+ - "10"
+ body:
+ encoding: UTF-8
+ string: Hello bazz
http_version:
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
recorded_with: VCR 2.0.0
View
26 features/record_modes/all.feature
@@ -26,22 +26,26 @@ Feature: :all
"""
And a previously recorded cassette file "cassettes/example.yml" with:
"""
- ---
- http_interactions:
- - request:
+ ---
+ http_interactions:
+ - request:
method: get
uri: http://localhost:7777/
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Length:
- - '20'
- body: old response
- http_version: '1.1'
+ headers:
+ Content-Length:
+ - "20"
+ body:
+ encoding: UTF-8
+ string: old response
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
recorded_with: VCR 2.0.0
"""
View
26 features/record_modes/new_episodes.feature
@@ -25,22 +25,26 @@ Feature: :new_episodes
"""
And a previously recorded cassette file "cassettes/example.yml" with:
"""
- ---
- http_interactions:
- - request:
+ ---
+ http_interactions:
+ - request:
method: get
uri: http://example.com/foo
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Length:
- - '20'
- body: example.com response
- http_version: '1.1'
+ headers:
+ Content-Length:
+ - "20"
+ body:
+ encoding: UTF-8
+ string: example.com response
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
recorded_with: VCR 2.0.0
"""
View
26 features/record_modes/none.feature
@@ -21,22 +21,26 @@ Feature: :none
"""
And a previously recorded cassette file "cassettes/example.yml" with:
"""
- ---
- http_interactions:
- - request:
+ ---
+ http_interactions:
+ - request:
method: get
uri: http://example.com/foo
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Length:
- - '5'
- body: Hello
- http_version: '1.1'
+ headers:
+ Content-Length:
+ - "5"
+ body:
+ encoding: UTF-8
+ string: Hello
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
recorded_with: VCR 2.0.0
"""
View
26 features/record_modes/once.feature
@@ -28,22 +28,26 @@ Feature: :once
"""
And a previously recorded cassette file "cassettes/example.yml" with:
"""
- ---
- http_interactions:
- - request:
+ ---
+ http_interactions:
+ - request:
method: get
uri: http://example.com/foo
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Length:
- - '20'
- body: example.com response
- http_version: '1.1'
+ headers:
+ Content-Length:
+ - "20"
+ body:
+ encoding: UTF-8
+ string: example.com response
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
recorded_with: VCR 2.0.0
"""
View
48 features/request_matching/body.feature
@@ -5,37 +5,45 @@ Feature: Matching on Body
Background:
Given a previously recorded cassette file "cassettes/example.yml" with:
"""
- ---
- http_interactions:
- - request:
+ ---
+ http_interactions:
+ - request:
method: post
uri: http://example.net/some/long/path
- body: body1
+ body:
+ encoding: UTF-8
+ string: body1
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Length:
- - '14'
- body: body1 response
- http_version: '1.1'
+ headers:
+ Content-Length:
+ - "14"
+ body:
+ encoding: UTF-8
+ string: body1 response
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
- - request:
+ - request:
method: post
uri: http://example.net/some/long/path
- body: body2
+ body:
+ encoding: UTF-8
+ string: body2
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Length:
- - '14'
- body: body2 response
- http_version: '1.1'
+ headers:
+ Content-Length:
+ - "14"
+ body:
+ encoding: UTF-8
+ string: body2 response
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
recorded_with: VCR 2.0.0
"""
View
48 features/request_matching/custom_matcher.feature
@@ -15,37 +15,45 @@ Feature: Register and use a custom matcher
Background:
Given a previously recorded cassette file "cassettes/example.yml" with:
"""
- ---
- http_interactions:
- - request:
+ ---
+ http_interactions:
+ - request:
method: get
uri: http://foo.com:9000/foo
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Length:
- - '18'
- body: port 9000 response
- http_version: '1.1'
+ headers:
+ Content-Length:
+ - "18"
+ body:
+ encoding: UTF-8
+ string: port 9000 response
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
- - request:
+ - request:
method: get
uri: http://foo.com:8000/foo
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Length:
- - '18'
- body: port 8000 response
- http_version: '1.1'
+ headers:
+ Content-Length:
+ - "18"
+ body:
+ encoding: UTF-8
+ string: port 8000 response
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
recorded_with: VCR 2.0.0
"""
View
60 features/request_matching/headers.feature
@@ -5,41 +5,49 @@ Feature: Matching on Headers
Scenario Outline: Replay interaction that matches the headers
Given a previously recorded cassette file "cassettes/example.yml" with:
"""
- ---
- http_interactions:
- - request:
+ ---
+ http_interactions:
+ - request:
method: post
uri: http://example.net/some/long/path
- body: ''
- headers:
- X-User-Id:
- - '1'
- response:
- status:
+ body:
+ encoding: UTF-8
+ string: ""
+ headers:
+ X-User-Id:
+ - "1"
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Length:
- - '15'
- body: user 1 response
- http_version: '1.1'
+ headers:
+ Content-Length:
+ - "15"
+ body:
+ encoding: UTF-8
+ string: user 1 response
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
- - request:
+ - request:
method: post
uri: http://example.net/some/long/path
- body: ''
- headers:
- X-User-Id:
- - '2'
- response:
- status:
+ body:
+ encoding: UTF-8
+ string: ""
+ headers:
+ X-User-Id:
+ - "2"
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Length:
- - '15'
- body: user 2 response
- http_version: '1.1'
+ headers:
+ Content-Length:
+ - "15"
+ body:
+ encoding: UTF-8
+ string: user 2 response
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
recorded_with: VCR 2.0.0
"""
View
48 features/request_matching/host.feature
@@ -9,37 +9,45 @@ Feature: Matching on Host
Background:
Given a previously recorded cassette file "cassettes/example.yml" with:
"""
- ---
- http_interactions:
- - request:
+ ---
+ http_interactions:
+ - request:
method: post
uri: http://host1.com/some/long/path
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Length:
- - '14'
- body: host1 response
- http_version: '1.1'
+ headers:
+ Content-Length:
+ - "14"
+ body:
+ encoding: UTF-8
+ string: host1 response
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
- - request:
+ - request:
method: post
uri: http://host2.com/some/other/long/path
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Length:
- - '16'
- body: host2 response
- http_version: '1.1'
+ headers:
+ Content-Length:
+ - "16"
+ body:
+ encoding: UTF-8
+ string: host2 response
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
recorded_with: VCR 2.0.0
"""
View
48 features/request_matching/identical_request_sequence.feature
@@ -8,37 +8,45 @@ Feature: Identical requests are replayed in sequence
Scenario Outline: identical requests are replayed in sequence
Given a previously recorded cassette file "cassettes/example.yml" with:
"""
- ---
- http_interactions:
- - request:
+ ---
+ http_interactions:
+ - request:
method: get
uri: http://example.com/foo
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Length:
- - '10'
- body: Response 1
- http_version: '1.1'
+ headers:
+ Content-Length:
+ - "10"
+ body:
+ encoding: UTF-8
+ string: Response 1
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
- - request:
+ - request:
method: get
uri: http://example.com/foo
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Length:
- - '10'
- body: Response 2
- http_version: '1.1'
+ headers:
+ Content-Length:
+ - "10"
+ body:
+ encoding: UTF-8
+ string: Response 2
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
recorded_with: VCR 2.0.0
"""
View
48 features/request_matching/method.feature
@@ -10,37 +10,45 @@ Feature: Matching on Method
Background:
Given a previously recorded cassette file "cassettes/example.yml" with:
"""
- ---
- http_interactions:
- - request:
+ ---
+ http_interactions:
+ - request:
method: post
uri: http://post-request.com/
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Length:
- - '13'
- body: post response
- http_version: '1.1'
+ headers:
+ Content-Length:
+ - "13"
+ body:
+ encoding: UTF-8
+ string: post response
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
- - request:
+ - request:
method: get
uri: http://get-request.com/
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Length:
- - '12'
- body: get response
- http_version: '1.1'
+ headers:
+ Content-Length:
+ - "12"
+ body:
+ encoding: UTF-8
+ string: get response
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
recorded_with: VCR 2.0.0
"""
View
48 features/request_matching/path.feature
@@ -10,37 +10,45 @@ Feature: Matching on Path
Background:
Given a previously recorded cassette file "cassettes/example.yml" with:
"""
- ---
- http_interactions:
- - request:
+ ---
+ http_interactions:
+ - request:
method: post
uri: http://host1.com/about?date=2011-09-01
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Length:
- - '14'
- body: about response
- http_version: '1.1'
+ headers:
+ Content-Length:
+ - "14"
+ body:
+ encoding: UTF-8
+ string: about response
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
- - request:
+ - request:
method: post
uri: http://host2.com/home?date=2011-09-01
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Length:
- - '15'
- body: home response
- http_version: '1.1'
+ headers:
+ Content-Length:
+ - "15"
+ body:
+ encoding: UTF-8
+ string: home response
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
recorded_with: VCR 2.0.0
"""
View
48 features/request_matching/playback_repeats.feature
@@ -16,37 +16,45 @@ Feature: Playback repeats
Scenario: Responses do not repeat by default
Given a previously recorded cassette file "cassettes/example.yml" with:
"""
- ---
- http_interactions:
- - request:
+ ---
+ http_interactions:
+ - request:
method: get
uri: http://example.com/foo
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Length:
- - '10'
- body: Response 1
- http_version: '1.1'
+ headers:
+ Content-Length:
+ - "10"
+ body:
+ encoding: UTF-8
+ string: Response 1
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
- - request:
+ - request:
method: get
uri: http://example.com/foo
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Length:
- - '10'
- body: Response 2
- http_version: '1.1'
+ headers:
+ Content-Length:
+ - "10"
+ body:
+ encoding: UTF-8
+ string: Response 2
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
recorded_with: VCR 2.0.0
"""
View
48 features/request_matching/uri.feature
@@ -8,37 +8,45 @@ Feature: Matching on URI
Background:
Given a previously recorded cassette file "cassettes/example.yml" with:
"""
- ---
- http_interactions:
- - request:
+ ---
+ http_interactions:
+ - request:
method: post
uri: http://example.com/foo
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Length:
- - '12'
- body: foo response
- http_version: '1.1'
+ headers:
+ Content-Length:
+ - "12"
+ body:
+ encoding: UTF-8
+ string: foo response
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
- - request:
+ - request:
method: post
uri: http://example.com/bar
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Length:
- - '12'
- body: bar response
- http_version: '1.1'
+ headers:
+ Content-Length:
+ - "12"
+ body:
+ encoding: UTF-8
+ string: bar response
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
recorded_with: VCR 2.0.0
"""
View
48 features/request_matching/uri_without_param.feature
@@ -16,37 +16,45 @@ Feature: URI without param(s)
Background:
Given a previously recorded cassette file "cassettes/example.yml" with:
"""
- ---
- http_interactions:
- - request:
+ ---
+ http_interactions:
+ - request:
method: get
uri: http://example.com/search?q=foo&timestamp=1316920490
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Length:
- - '12'
- body: foo response
- http_version: '1.1'
+ headers:
+ Content-Length:
+ - "12"
+ body:
+ encoding: UTF-8
+ string: foo response
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
- - request:
+ - request:
method: get
uri: http://example.com/search?q=bar&timestamp=1296723437
- body: ''
+ body:
+ encoding: UTF-8
+ string: ""
headers: {}
- response:
- status:
+ response:
+ status:
code: 200
message: OK
- headers:
- Content-Length:
- - '12'
- body: bar response
- http_version: '1.1'
+ headers:
+ Content-Length:
+ - "12"
+ body:
+ encoding: UTF-8
+ string: bar response
+ http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
recorded_with: VCR 2.0.0
"""

0 comments on commit 531acdf

Please sign in to comment.
Something went wrong with that request. Please try again.