rspec-support 3.1.2 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d956dee8e8ec2188fcfbbfd4ebbea36ec71ee80e
4
- data.tar.gz: 7682ba44730a0cd46b27dd685b3c9f60da93ef4c
3
+ metadata.gz: 04039acbffa124e0356893dfd6b37ad6793fff39
4
+ data.tar.gz: d0e082625d0329b2e918a77aa06f71c41e4672bf
5
5
  SHA512:
6
- metadata.gz: 7abcbe97b35a4693f93d4f21024d9dd60aea8b9eea9ebfb0c8d01b51982f87ab208413e42ac7bfcd78b0209b4313aaa87ffd06ef3764c78123dd9ebbac83ee48
7
- data.tar.gz: db6c79b4c9710880a610922714f5e55c1e67fa9bc41d5ac0c30f79de93614d6a95040f2368e6f94aeca4a774f3c1ffe70123afde46cc7eca936fa0ecd33a8c72
6
+ metadata.gz: 97526b21209f907da6435684583005b57d16a4208772f2986ee83ce9b3e08e17fbc63b8f20865c30ff91c177fef627e0cb5c431f2a6e2e81b9fd1d3dde1eadbd
7
+ data.tar.gz: 6a65cd43926b771a5483b2a2acabbb9cb81377c19a58570d7a9ce3780a88ce8f5a30e9a2e8feaedb26573f0c02ed8752f3d4cc24e5d77b26c0ddc073621de214
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/Changelog.md CHANGED
@@ -1,3 +1,16 @@
1
+ ### 3.2.0 / 2015-02-03
2
+ [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.1.2...v3.2.0)
3
+
4
+ Enhancements:
5
+
6
+ * Add extra Ruby type detection. (Jon Rowe, #133)
7
+ * Make differ instance re-usable. (Alexey Fedorov, #160)
8
+
9
+ Bug Fixes:
10
+
11
+ * Do not consider `[]` and `{}` to match when performing fuzzy matching.
12
+ (Myron Marston, #157)
13
+
1
14
  ### 3.1.2 / 2014-10-08
2
15
  [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.1.1...v3.1.2)
3
16
 
data/README.md CHANGED
@@ -8,6 +8,15 @@ suitable for internal use only at this time.
8
8
 
9
9
  Install one or more of the `RSpec` gems.
10
10
 
11
+ Want to run against the `master` branch? You'll need to include the dependent
12
+ RSpec repos as well. Add the following to your `Gemfile`:
13
+
14
+ ```ruby
15
+ %w[rspec-core rspec-expectations rspec-mocks rspec-support].each do |lib|
16
+ gem lib, :git => "git://github.com/rspec/#{lib}.git", :branch => 'master'
17
+ end
18
+ ```
19
+
11
20
  ## Contributing
12
21
 
13
22
  1. Fork it
@@ -26,7 +26,29 @@ module RSpec
26
26
  IGNORE_REGEX = Regexp.union(LIB_REGEX, "rubygems/core_ext/kernel_require.rb")
27
27
 
28
28
  if RUBY_VERSION >= '2.0.0'
29
- def self.first_non_rspec_line
29
+ # This supports args because it's more efficient when the caller specifies
30
+ # these. It allows us to skip frames the caller knows are part of RSpec,
31
+ # and to decrease the increment size if the caller is confident the line will
32
+ # be found in a small number of stack frames from `skip_frames`.
33
+ #
34
+ # Note that there is a risk to passing a `skip_frames` value that is too high:
35
+ # If it skippped the first non-rspec line, then this method would return the
36
+ # 2nd or 3rd (or whatever) non-rspec line. Thus, you generally shouldn't pass
37
+ # values for these parameters, particularly since most places that use this are
38
+ # not hot spots (generally it gets used for deprecation warnings). However,
39
+ # if you do have a hot spot that calls this, passing `skip_frames` can make
40
+ # a significant difference. Just make sure that that particular use is tested
41
+ # so that if the provided `skip_frames` changes to no longer be accurate in
42
+ # such a way that would return the wrong stack frame, a test will fail to tell you.
43
+ #
44
+ # See benchmarks/skip_frames_for_caller_filter.rb for measurements.
45
+ def self.first_non_rspec_line(skip_frames=3, increment=5)
46
+ # Why a default `skip_frames` of 3?
47
+ # By the time `caller_locations` is called below, the first 3 frames are:
48
+ # lib/rspec/support/caller_filter.rb:63:in `block in first_non_rspec_line'
49
+ # lib/rspec/support/caller_filter.rb:62:in `loop'
50
+ # lib/rspec/support/caller_filter.rb:62:in `first_non_rspec_line'
51
+
30
52
  # `caller` is an expensive method that scales linearly with the size of
31
53
  # the stack. The performance hit for fetching it in chunks is small,
32
54
  # and since the target line is probably near the top of the stack, the
@@ -34,28 +56,24 @@ module RSpec
34
56
  #
35
57
  # See benchmarks/caller.rb for measurements.
36
58
 
37
- # Initial value here is mostly arbitrary, but is chosen to give good
38
- # performance on the common case of creating a double.
39
- increment = 5
40
- i = 1
41
- line = nil
59
+ # The default increment of 5 for this method are mostly arbitrary, but
60
+ # is chosen to give good performance on the common case of creating a double.
42
61
 
43
- until line
44
- stack = caller(i, increment)
62
+ loop do
63
+ stack = caller_locations(skip_frames, increment)
45
64
  raise "No non-lib lines in stack" unless stack
46
65
 
47
- line = stack.find { |l| l !~ IGNORE_REGEX }
66
+ line = stack.find { |l| l.path !~ IGNORE_REGEX }
67
+ return line.to_s if line
48
68
 
49
- i += increment
50
- increment *= 2 # The choice of two here is arbitrary.
69
+ skip_frames += increment
70
+ increment *= 2 # The choice of two here is arbitrary.
51
71
  end
52
-
53
- line
54
72
  end
55
73
  else
56
74
  # Earlier rubies do not support the two argument form of `caller`. This
57
75
  # fallback is logically the same, but slower.
58
- def self.first_non_rspec_line
76
+ def self.first_non_rspec_line(*)
59
77
  caller.find { |line| line !~ IGNORE_REGEX }
60
78
  end
61
79
  end
@@ -25,12 +25,13 @@ module RSpec
25
25
 
26
26
  # rubocop:disable MethodLength
27
27
  def diff_as_string(actual, expected)
28
- @encoding = pick_encoding actual, expected
28
+ encoding = pick_encoding(actual, expected)
29
29
 
30
- @actual = EncodedString.new(actual, @encoding)
31
- @expected = EncodedString.new(expected, @encoding)
30
+ actual = EncodedString.new(actual, encoding)
31
+ expected = EncodedString.new(expected, encoding)
32
32
 
33
- output = EncodedString.new("\n", @encoding)
33
+ output = EncodedString.new("\n", encoding)
34
+ hunks = build_hunks(actual, expected)
34
35
 
35
36
  hunks.each_cons(2) do |prev_hunk, current_hunk|
36
37
  begin
@@ -48,7 +49,7 @@ module RSpec
48
49
 
49
50
  color_diff output
50
51
  rescue Encoding::CompatibilityError
51
- handle_encoding_errors
52
+ handle_encoding_errors(actual, expected)
52
53
  end
53
54
  # rubocop:enable MethodLength
54
55
 
@@ -109,8 +110,8 @@ module RSpec
109
110
  end
110
111
  end
111
112
 
112
- def hunks
113
- @hunks ||= HunkGenerator.new(@actual, @expected).hunks
113
+ def build_hunks(actual, expected)
114
+ HunkGenerator.new(actual, expected).hunks
114
115
  end
115
116
 
116
117
  def finalize_output(output, final_line)
@@ -198,14 +199,14 @@ module RSpec
198
199
  end
199
200
  end
200
201
 
201
- def handle_encoding_errors
202
- if @actual.source_encoding != @expected.source_encoding
202
+ def handle_encoding_errors(actual, expected)
203
+ if actual.source_encoding != expected.source_encoding
203
204
  "Could not produce a diff because the encoding of the actual string " \
204
- "(#{@actual.source_encoding}) differs from the encoding of the expected " \
205
- "string (#{@expected.source_encoding})"
205
+ "(#{actual.source_encoding}) differs from the encoding of the expected " \
206
+ "string (#{expected.source_encoding})"
206
207
  else
207
208
  "Could not produce a diff because of the encoding of the string " \
208
- "(#{@expected.source_encoding})"
209
+ "(#{expected.source_encoding})"
209
210
  end
210
211
  end
211
212
  end
@@ -1,4 +1,4 @@
1
- RSpec::Support.require_rspec_support 'os'
1
+ RSpec::Support.require_rspec_support 'ruby_features'
2
2
 
3
3
  module RSpec
4
4
  module Support
@@ -2,7 +2,18 @@ module RSpec
2
2
  module Support
3
3
  # @private
4
4
  class EncodedString
5
- MRI_UNICODE_UNKOWN_CHARACTER = "\xEF\xBF\xBD"
5
+ # Reduce allocations by storing constants.
6
+ UTF_8 = "UTF-8"
7
+ US_ASCII = 'US-ASCII'
8
+ # else: '?' 63.chr ("\x3F")
9
+ REPLACE = "?"
10
+ ENCODE_UNCONVERTABLE_BYTES = {
11
+ :invalid => :replace,
12
+ :undef => :replace
13
+ }
14
+ ENCODE_NO_CONVERTER = {
15
+ :invalid => :replace,
16
+ }
6
17
 
7
18
  def initialize(string, encoding=nil)
8
19
  @encoding = encoding
@@ -33,17 +44,59 @@ module RSpec
33
44
 
34
45
  private
35
46
 
47
+ # Encoding Exceptions:
48
+ #
49
+ # Raised by Encoding and String methods:
50
+ # Encoding::UndefinedConversionError:
51
+ # when a transcoding operation fails
52
+ # if the String contains characters invalid for the target encoding
53
+ # e.g. "\x80".encode('UTF-8','ASCII-8BIT')
54
+ # vs "\x80".encode('UTF-8','ASCII-8BIT', undef: :replace, replace: '<undef>')
55
+ # # => '<undef>'
56
+ # Encoding::CompatibilityError
57
+ # when Enconding.compatbile?(str1, str2) is false
58
+ # e.g. utf_16le_emoji_string.split("\n")
59
+ # e.g. valid_unicode_string.encode(utf8_encoding) << ascii_string
60
+ # Encoding::InvalidByteSequenceError:
61
+ # when the string being transcoded contains a byte invalid for
62
+ # either the source or target encoding
63
+ # e.g. "\x80".encode('UTF-8','US-ASCII')
64
+ # vs "\x80".encode('UTF-8','US-ASCII', invalid: :replace, replace: '<byte>')
65
+ # # => '<byte>'
66
+ # ArgumentError
67
+ # when operating on a string with invalid bytes
68
+ # e.g."\xEF".split("\n")
69
+ # TypeError
70
+ # when a symbol is passed as an encoding
71
+ # Encoding.find(:"utf-8")
72
+ # when calling force_encoding on an object
73
+ # that doesn't respond to #to_str
74
+ #
75
+ # Raised by transcoding methods:
76
+ # Encoding::ConverterNotFoundError:
77
+ # when a named encoding does not correspond with a known converter
78
+ # e.g. 'abc'.force_encoding('UTF-8').encode('foo')
79
+ # or a converter path cannot be found
80
+ # e.g. "\x80".force_encoding('ASCII-8BIT').encode('Emacs-Mule')
81
+ #
82
+ # Raised by byte <-> char conversions
83
+ # RangeError: out of char range
84
+ # e.g. the UTF-16LE emoji: 128169.chr
36
85
  def matching_encoding(string)
37
86
  string.encode(@encoding)
38
87
  rescue Encoding::UndefinedConversionError, Encoding::InvalidByteSequenceError
39
- normalize_missing(string.encode(@encoding, :invalid => :replace, :undef => :replace))
88
+ normalize_missing(string.encode(@encoding, ENCODE_UNCONVERTABLE_BYTES))
40
89
  rescue Encoding::ConverterNotFoundError
41
- normalize_missing(string.force_encoding(@encoding).encode(:invalid => :replace))
90
+ normalize_missing(string.dup.force_encoding(@encoding).encode(ENCODE_NO_CONVERTER))
42
91
  end
43
92
 
93
+ # Ruby's default replacement string is:
94
+ # for Unicode encoding forms: U+FFFD ("\xEF\xBF\xBD")
95
+ MRI_UNICODE_UNKOWN_CHARACTER = "\xEF\xBF\xBD".force_encoding(UTF_8)
96
+
44
97
  def normalize_missing(string)
45
- if @encoding.to_s == "UTF-8"
46
- string.gsub(MRI_UNICODE_UNKOWN_CHARACTER.force_encoding(@encoding), "?")
98
+ if @encoding.to_s == UTF_8
99
+ string.gsub(MRI_UNICODE_UNKOWN_CHARACTER, REPLACE)
47
100
  else
48
101
  string
49
102
  end
@@ -61,7 +114,7 @@ module RSpec
61
114
  end
62
115
 
63
116
  def detect_source_encoding(_string)
64
- 'US-ASCII'
117
+ US_ASCII
65
118
  end
66
119
  end
67
120
  end
@@ -6,14 +6,14 @@ module RSpec
6
6
  module FuzzyMatcher
7
7
  # @api private
8
8
  def self.values_match?(expected, actual)
9
- if Array === expected && Enumerable === actual && !(Struct === actual)
9
+ if Hash === actual
10
+ return hashes_match?(expected, actual) if Hash === expected
11
+ elsif Array === expected && Enumerable === actual && !(Struct === actual)
10
12
  return arrays_match?(expected, actual.to_a)
11
- elsif Hash === expected && Hash === actual
12
- return hashes_match?(expected, actual)
13
- elsif actual == expected
14
- return true
15
13
  end
16
14
 
15
+ return true if actual == expected
16
+
17
17
  begin
18
18
  expected === actual
19
19
  rescue ArgumentError
@@ -27,5 +27,16 @@ module RSpec
27
27
  def self.is_a_matcher?(object)
28
28
  matcher_definitions.any? { |md| md.call(object) }
29
29
  end
30
+
31
+ # @api private
32
+ #
33
+ # gives a string representation of an object for use in RSpec descriptions
34
+ def self.rspec_description_for_object(object)
35
+ if RSpec::Support.is_a_matcher?(object) && object.respond_to?(:description)
36
+ object.description
37
+ else
38
+ object
39
+ end
40
+ end
30
41
  end
31
42
  end
@@ -9,10 +9,12 @@ module RSpec
9
9
  #
10
10
  # @private
11
11
  class MethodSignature
12
- attr_reader :min_non_kw_args, :max_non_kw_args
12
+ attr_reader :min_non_kw_args, :max_non_kw_args, :optional_kw_args, :required_kw_args
13
13
 
14
14
  def initialize(method)
15
- @method = method
15
+ @method = method
16
+ @optional_kw_args = []
17
+ @required_kw_args = []
16
18
  classify_parameters
17
19
  end
18
20
 
@@ -74,7 +76,6 @@ module RSpec
74
76
 
75
77
  def classify_parameters
76
78
  optional_non_kw_args = @min_non_kw_args = 0
77
- @optional_kw_args, @required_kw_args = [], []
78
79
  @allows_any_kw_args = false
79
80
 
80
81
  @method.parameters.each do |(type, name)|
@@ -1,13 +1,41 @@
1
1
  module RSpec
2
2
  module Support
3
+ # @api private
4
+ #
5
+ # Provides query methods for different OS or OS features.
6
+ module OS
7
+ module_function
8
+
9
+ def windows?
10
+ RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|mingw|bccwin|wince|emx/
11
+ end
12
+
13
+ def windows_file_path?
14
+ ::File::ALT_SEPARATOR == '\\'
15
+ end
16
+ end
17
+
3
18
  # @api private
4
19
  #
5
20
  # Provides query methods for different rubies
6
21
  module Ruby
22
+ module_function
23
+
7
24
  def jruby?
8
25
  RUBY_PLATFORM == 'java'
9
26
  end
10
- module_function :jruby?
27
+
28
+ def rbx?
29
+ defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
30
+ end
31
+
32
+ def non_mri?
33
+ !mri?
34
+ end
35
+
36
+ def mri?
37
+ !defined?(RUBY_ENGINE) || RUBY_ENGINE == 'ruby'
38
+ end
11
39
  end
12
40
 
13
41
  # @api private
@@ -15,31 +43,70 @@ module RSpec
15
43
  # Provides query methods for ruby features that differ among
16
44
  # implementations.
17
45
  module RubyFeatures
46
+ module_function
47
+
18
48
  def optional_and_splat_args_supported?
19
49
  Method.method_defined?(:parameters)
20
50
  end
21
- module_function :optional_and_splat_args_supported?
22
51
 
23
- def kw_args_supported?
24
- RUBY_VERSION >= '2.0.0' && RUBY_ENGINE != 'rbx' && RUBY_ENGINE != 'jruby'
25
- end
26
- module_function :kw_args_supported?
52
+ if Ruby.mri?
53
+ def kw_args_supported?
54
+ RUBY_VERSION >= '2.0.0'
55
+ end
56
+
57
+ def required_kw_args_supported?
58
+ RUBY_VERSION >= '2.1.0'
59
+ end
60
+
61
+ def supports_rebinding_module_methods?
62
+ RUBY_VERSION.to_i >= 2
63
+ end
64
+ else
65
+ # RBX / JRuby et al support is unknown for keyword arguments
66
+ # rubocop:disable Lint/Eval
67
+ begin
68
+ eval("o = Object.new; def o.m(a: 1); end;"\
69
+ " raise SyntaxError unless o.method(:m).parameters.include?([:key, :a])")
27
70
 
28
- def required_kw_args_supported?
29
- RUBY_VERSION >= '2.1.0' && RUBY_ENGINE != 'rbx' && RUBY_ENGINE != 'jruby'
71
+ def kw_args_supported?
72
+ true
73
+ end
74
+ rescue SyntaxError
75
+ def kw_args_supported?
76
+ false
77
+ end
78
+ end
79
+
80
+ begin
81
+ eval("o = Object.new; def o.m(a: ); end;"\
82
+ "raise SyntaxError unless o.method(:m).parameters.include?([:keyreq, :a])")
83
+
84
+ def required_kw_args_supported?
85
+ true
86
+ end
87
+ rescue SyntaxError
88
+ def required_kw_args_supported?
89
+ false
90
+ end
91
+ end
92
+
93
+ begin
94
+ Module.new { def foo; end }.instance_method(:foo).bind(Object.new)
95
+
96
+ def supports_rebinding_module_methods?
97
+ true
98
+ end
99
+ rescue TypeError
100
+ def supports_rebinding_module_methods?
101
+ false
102
+ end
103
+ end
104
+ # rubocop:enable Lint/Eval
30
105
  end
31
- module_function :required_kw_args_supported?
32
106
 
33
107
  def module_prepends_supported?
34
108
  Module.method_defined?(:prepend) || Module.private_method_defined?(:prepend)
35
109
  end
36
- module_function :module_prepends_supported?
37
-
38
- def supports_rebinding_module_methods?
39
- # RBX and JRuby don't yet support this.
40
- RUBY_VERSION.to_i >= 2 && RUBY_ENGINE != 'rbx' && RUBY_ENGINE != 'jruby'
41
- end
42
- module_function :supports_rebinding_module_methods?
43
110
  end
44
111
  end
45
112
  end
@@ -30,6 +30,10 @@ RSpec.configure do |c|
30
30
 
31
31
  c.filter_run :focus
32
32
  c.run_all_when_everything_filtered = true
33
+
34
+ c.define_derived_metadata :failing_on_appveyor do |meta|
35
+ meta[:pending] ||= "This spec fails on AppVeyor and needs someone to fix it."
36
+ end if ENV['APPVEYOR']
33
37
  end
34
38
 
35
39
  module RSpec
@@ -1,17 +1,21 @@
1
1
  module RSpec
2
2
  module Support
3
3
  module InSubProcess
4
- if Process.respond_to?(:fork) && !(RUBY_PLATFORM == 'java' && RUBY_VERSION == '1.8.7')
4
+ if Process.respond_to?(:fork) && !(Ruby.jruby? && RUBY_VERSION == '1.8.7')
5
+
5
6
  # Useful as a way to isolate a global change to a subprocess.
6
7
 
7
8
  # rubocop:disable MethodLength
8
- def in_sub_process
9
+ def in_sub_process(prevent_warnings=true)
9
10
  readme, writeme = IO.pipe
10
11
 
11
12
  pid = Process.fork do
12
13
  exception = nil
14
+ warning_preventer = $stderr = RSpec::Support::StdErrSplitter.new($stderr)
15
+
13
16
  begin
14
17
  yield
18
+ warning_preventer.verify_example!(self) if prevent_warnings
15
19
  rescue Exception => e
16
20
  exception = e
17
21
  end
@@ -32,7 +36,7 @@ module RSpec
32
36
  raise exception if exception
33
37
  end
34
38
  else
35
- def in_sub_process
39
+ def in_sub_process(*)
36
40
  skip "This spec requires forking to work properly, " \
37
41
  "and your platform does not support forking"
38
42
  end
@@ -3,12 +3,13 @@ require 'rspec/support/spec/shell_out'
3
3
  module RSpec
4
4
  module Support
5
5
  module WarningsPrevention
6
- def files_to_require_for(lib)
6
+ def files_to_require_for(lib, sub_dir)
7
7
  slash = File::SEPARATOR
8
8
  lib_path_re = /#{slash + lib}[^#{slash}]*#{slash}lib/
9
9
  load_path = $LOAD_PATH.grep(lib_path_re).first
10
- files = Dir["#{load_path}/**/*.rb"]
11
- extract_regex = /#{Regexp.escape(load_path) + File::SEPARATOR}(.+)\.rb$/
10
+ directory = load_path.sub(/lib$/, sub_dir)
11
+ files = Dir["#{directory}/**/*.rb"]
12
+ extract_regex = /#{Regexp.escape(directory) + File::SEPARATOR}(.+)\.rb$/
12
13
 
13
14
  # We sort to ensure the files are loaded in a consistent order, regardless
14
15
  # of OS. Otherwise, it could load in a different order on Travis than
@@ -24,21 +25,32 @@ RSpec.shared_examples_for "a library that issues no warnings when loaded" do |li
24
25
  include RSpec::Support::ShellOut
25
26
  include RSpec::Support::WarningsPrevention
26
27
 
27
- it "issues no warnings when loaded", :slow do
28
+ define_method :expect_no_warnings_from_files_in do |sub_dir, *pre_stmnts|
28
29
  # We want to explicitly load every file because each lib has some files that
29
30
  # aren't automatically loaded, instead being delayed based on an autoload
30
31
  # (such as for rspec-expectations' matchers) or based on a config option
31
32
  # (e.g. `config.mock_with :rr` => 'rspec/core/mocking_adapters/rr').
32
- statements = preamble_stmnts + files_to_require_for(lib).map do |file|
33
+ files_to_require = files_to_require_for(lib, sub_dir)
34
+ statements = pre_stmnts + files_to_require.map do |file|
33
35
  "require '#{file}'"
34
36
  end
35
37
 
36
38
  command = statements.join("; ")
37
39
 
38
- stdout, stderr, status = run_ruby_with_current_load_path(command, "-w")
40
+ stdout, stderr, status = with_env 'NO_COVERAGE' => '1' do
41
+ run_ruby_with_current_load_path(command, "-w")
42
+ end
39
43
 
40
44
  expect(stdout).to eq("")
41
45
  expect(stderr).to eq("")
42
46
  expect(status.exitstatus).to eq(0)
43
47
  end
48
+
49
+ it "issues no warnings when loaded", :slow do
50
+ expect_no_warnings_from_files_in "lib", *preamble_stmnts
51
+ end
52
+
53
+ it "issues no warnings when the spec files are loaded", :slow do
54
+ expect_no_warnings_from_files_in "spec", "require 'rspec/core'; require 'spec_helper'"
55
+ end
44
56
  end
@@ -10,11 +10,11 @@ module RSpec
10
10
 
11
11
  respond_to_name = (::RUBY_VERSION.to_f < 1.9) ? :respond_to? : :respond_to_missing?
12
12
  define_method respond_to_name do |*args|
13
- @orig_stderr.respond_to?(*args) || super
13
+ @orig_stderr.respond_to?(*args) || super(*args)
14
14
  end
15
15
 
16
16
  def method_missing(name, *args, &block)
17
- @output_tracker.__send__(name, *args, &block)
17
+ @output_tracker.__send__(name, *args, &block) if @output_tracker.respond_to?(name)
18
18
  @orig_stderr.__send__(name, *args, &block)
19
19
  end
20
20
 
@@ -22,6 +22,17 @@ module RSpec
22
22
  @orig_stderr == other
23
23
  end
24
24
 
25
+ def reopen(*args)
26
+ reset!
27
+ @orig_stderr.reopen(*args)
28
+ end
29
+
30
+ # To work around JRuby error:
31
+ # can't convert RSpec::Support::StdErrSplitter into String
32
+ def to_io
33
+ @orig_stderr.to_io
34
+ end
35
+
25
36
  # To work around JRuby error:
26
37
  # TypeError: $stderr must have write method, RSpec::StdErrSplitter given
27
38
  def write(line)
@@ -1,7 +1,7 @@
1
1
  module RSpec
2
2
  module Support
3
3
  module Version
4
- STRING = '3.1.2'
4
+ STRING = '3.2.0'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-support
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.2
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Chelimsky
@@ -15,28 +15,40 @@ bindir: bin
15
15
  cert_chain:
16
16
  - |
17
17
  -----BEGIN CERTIFICATE-----
18
- MIIDjjCCAnagAwIBAgIBATANBgkqhkiG9w0BAQUFADBGMRIwEAYDVQQDDAlyc3Bl
19
- Yy1kZXYxGzAZBgoJkiaJk/IsZAEZFgtnb29nbGVnb3VwczETMBEGCgmSJomT8ixk
20
- ARkWA2NvbTAeFw0xMzExMDcxOTQyNTlaFw0xNDExMDcxOTQyNTlaMEYxEjAQBgNV
21
- BAMMCXJzcGVjLWRldjEbMBkGCgmSJomT8ixkARkWC2dvb2dsZWdvdXBzMRMwEQYK
22
- CZImiZPy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09 00:00:00.000000000 Z
51
+ date: 2015-02-03 00:00:00.000000000 Z
40
52
  dependencies:
41
53
  - !ruby/object:Gem::Dependency
42
54
  name: bundler
@@ -84,7 +96,6 @@ files:
84
96
  - lib/rspec/support/hunk_generator.rb
85
97
  - lib/rspec/support/matcher_definition.rb
86
98
  - lib/rspec/support/method_signature_verifier.rb
87
- - lib/rspec/support/os.rb
88
99
  - lib/rspec/support/recursive_const_methods.rb
89
100
  - lib/rspec/support/ruby_features.rb
90
101
  - lib/rspec/support/spec.rb
@@ -123,5 +134,5 @@ rubyforge_project: rspec
123
134
  rubygems_version: 2.2.2
124
135
  signing_key:
125
136
  specification_version: 4
126
- summary: rspec-support-3.1.2
137
+ summary: rspec-support-3.2.0
127
138
  test_files: []
metadata.gz.sig CHANGED
Binary file
@@ -1,18 +0,0 @@
1
- module RSpec
2
- module Support
3
- # @api private
4
- #
5
- # Provides query methods for different OS or OS features.
6
- module OS
7
- def windows?
8
- RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|mingw|bccwin|wince|emx/
9
- end
10
- module_function :windows?
11
-
12
- def windows_file_path?
13
- ::File::ALT_SEPARATOR == '\\'
14
- end
15
- module_function :windows_file_path?
16
- end
17
- end
18
- end