vcr 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -2,7 +2,15 @@
2
2
 
3
3
  ## In git
4
4
 
5
- [Full Changelog](http://github.com/myronmarston/vcr/compare/v1.5.0...master)
5
+ [Full Changelog](http://github.com/myronmarston/vcr/compare/v1.5.1...master)
6
+
7
+ ## 1.5.1 (January 12, 2011)
8
+
9
+ [Full Changelog](http://github.com/myronmarston/vcr/compare/v1.5.0...v1.5.1)
10
+
11
+ * Fix response and request serialization so that the headers are raw
12
+ strings. This fixes intermittent YAML seg faults for paperclip
13
+ uploads to S3. But reported by [Rob Slifka](https://github.com/rslifka).
6
14
 
7
15
  ## 1.5.0 (January 12, 2011)
8
16
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vcr (1.5.0)
4
+ vcr (1.5.1)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
data/Rakefile CHANGED
@@ -5,7 +5,10 @@ Bundler::GemHelper.install_tasks
5
5
  require 'rake'
6
6
  require "rspec/core/rake_task"
7
7
 
8
- RSpec::Core::RakeTask.new(:spec)
8
+ RSpec::Core::RakeTask.new(:spec) do |t|
9
+ t.verbose = false
10
+ t.rspec_opts = %w[--format progress] if ENV['FULL_BUILD']
11
+ end
9
12
 
10
13
  desc "Run all examples using rcov"
11
14
  RSpec::Core::RakeTask.new :rcov => :cleanup_rcov_files do |t|
data/lib/vcr/structs.rb CHANGED
@@ -61,7 +61,14 @@ module VCR
61
61
  important_vals = important_header_values(k, val_array)
62
62
  next unless important_vals.size > 0
63
63
 
64
- new_headers[k] = important_vals
64
+ # Ensure the values are raw strings.
65
+ # Apparently for Paperclip uploads to S3, headers
66
+ # get serialized with some extra stuff which leads
67
+ # to a seg fault. See this issue for more info:
68
+ # https://github.com/myronmarston/vcr/issues#issue/39
69
+ string_vals = important_vals.map { |v| String.new(v) }
70
+
71
+ new_headers[k] = string_vals
65
72
  end if headers
66
73
 
67
74
  self.headers = new_headers.empty? ? nil : new_headers
data/lib/vcr/version.rb CHANGED
@@ -3,7 +3,7 @@ module VCR
3
3
 
4
4
  def version
5
5
  @version ||= begin
6
- string = '1.5.0'
6
+ string = '1.5.1'
7
7
 
8
8
  def string.parts; VCR.version.split('.').map { |p| p.to_i }; end
9
9
  def string.major; parts[0]; end
@@ -1,19 +1,46 @@
1
1
  # this is in a separate rakefile because our main one depends on the bundled gems
2
2
  # already being installed. This must be able to run w/o bundled gems installed.
3
3
 
4
+ def rake(command = "")
5
+ sh "rake #{command} FULL_BUILD=true"
6
+ end
7
+
4
8
  desc "Run a full build: install necessary gems with bundler, runs specs, run cukes"
5
- task :build => :ensure_bundler_installed do
6
- sh "bundle install"
7
- sh "rake"
9
+ task :build => :bundle_install do
10
+ rake
11
+ end
12
+
13
+ desc "Install necessary gems with bundler and runs specs"
14
+ task :spec => :bundle_install do
15
+ rake "spec"
16
+ end
17
+
18
+ desc "Install necessary gems with bundler and runs cukes"
19
+ task :cucumber => :bundle_install do
20
+ rake "cucumber"
21
+ end
22
+
23
+ desc "Prints description of current ruby interpreter"
24
+ task :print_ruby_description do
25
+ description = if defined?(RUBY_DESCRIPTION)
26
+ RUBY_DESCRIPTION
27
+ else
28
+ # RUBY_DESCRIPTION is undefined on 1.8.6
29
+ "ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE} patchlevel #{RUBY_PATCHLEVEL}) [#{RUBY_PLATFORM}]"
30
+ end
31
+
32
+ puts
33
+ puts "=" * 80
34
+ puts "Using #{description}"
35
+ puts "=" * 80
36
+ puts
8
37
  end
9
38
 
10
- desc "Install necessary gems with bundler, runs specs, run cukes"
11
- task :spec => :ensure_bundler_installed do
39
+ task :bundle_install => :ensure_bundler_installed do
12
40
  sh "bundle install"
13
- sh "rake spec"
14
41
  end
15
42
 
16
- task :ensure_bundler_installed do
43
+ task :ensure_bundler_installed => :print_ruby_description do
17
44
  installed = begin
18
45
  require 'rubygems'
19
46
  require 'bundler'
@@ -26,3 +53,4 @@ task :ensure_bundler_installed do
26
53
  sh "gem install bundler"
27
54
  end
28
55
  end
56
+
@@ -23,6 +23,20 @@ shared_examples_for "a header normalizer" do
23
23
  it 'sets empty hash header to nil' do
24
24
  with_headers({}).headers.should be_nil
25
25
  end
26
+
27
+ it 'ensures header keys are serialized to yaml as raw strings' do
28
+ key = 'my-key'
29
+ key.instance_variable_set(:@foo, 7)
30
+ instance = with_headers(key => ['value1'])
31
+ instance.headers.to_yaml.should == { 'my-key' => ['value1'] }.to_yaml
32
+ end
33
+
34
+ it 'ensures header values are serialized to yaml as raw strings' do
35
+ value = 'my-value'
36
+ value.instance_variable_set(:@foo, 7)
37
+ instance = with_headers('my-key' => [value])
38
+ instance.headers.to_yaml.should == { 'my-key' => ['my-value'] }.to_yaml
39
+ end
26
40
  end
27
41
 
28
42
  shared_examples_for "a body normalizer" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vcr
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 5
9
- - 0
10
- version: 1.5.0
9
+ - 1
10
+ version: 1.5.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Myron Marston
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-12 00:00:00 -08:00
18
+ date: 2011-01-21 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency