rspec-support 3.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NTY1ODMyNjMwYTQ5NmNiYTE2ZDE0Yzg4NmNjYjM3MTg1Y2M1OGMwOA==
5
+ data.tar.gz: !binary |-
6
+ ZDUyM2RhMTFkYjYwZGMwZTQwNzhjYzM4ZDE4Y2Y3OTMwMjQxYzE0Zg==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ N2M3ZjE0Y2VhMGY4NWQ0YmM2ODk4NmNkNDQ3ZjI5M2M1MzQ5ZjZiMjE0NzA2
10
+ MGE5MzMxOWI1MTRjZDAwNzhiNDE1ZDBmYjMyZGY3NmNjMjZjZTBlZGY4ZWM2
11
+ OWVjMjM5NDQ0Y2EyMjM1YTZhNDA2NTAxYWUwZjk5NWU0ZDE4MmU=
12
+ data.tar.gz: !binary |-
13
+ ZTI5ZTRiNjFjYTQyNjY2ZTY4YzU5NDJiYzAwMDlkMWE1ZjYyN2E3NzMzYzVm
14
+ NzcwY2YxMTc3YTZlMDZhNzMxOGExMTg2Y2ViOWFmODg1ODBhMTk5ZGVkYTFk
15
+ OTRiMWUzMmUzNjJhMjU1M2E3Yzg3YjdhYzY0OGFjZWMzYzg2ZWQ=
Binary file
Binary file
@@ -0,0 +1,5 @@
1
+ ### 3.0.0.beta1 / 2013-11-07
2
+ [full changelog](https://github.com/rspec/rspec-support/compare/0dc12d1bdbbacc757a9989f8c09cd08ef3a4837e...v3.0.0.beta1)
3
+
4
+ Initial release.
5
+
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 David Chelimsky, Myron Marston, Jon Rowe, Sam Phippen, Xavier Shay, Bradley Schaefer
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,17 @@
1
+ # RSpec::Support
2
+
3
+ `RSpec::Support` provides common functionality to `RSpec::Core`,
4
+ `RSpec::Expectations` and `RSpec::Mocks`. It is considered
5
+ suitable for internal use only at this time.
6
+
7
+ ## Installation / Usage
8
+
9
+ Install one or more of the `RSpec` gems.
10
+
11
+ ## Contributing
12
+
13
+ 1. Fork it
14
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
15
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
16
+ 4. Push to the branch (`git push origin my-new-feature`)
17
+ 5. Create new Pull Request
@@ -0,0 +1,6 @@
1
+ require "rspec/support/version"
2
+
3
+ module RSpec
4
+ module Support
5
+ end
6
+ end
@@ -0,0 +1,56 @@
1
+ module RSpec
2
+ # Consistent implementation for "cleaning" the caller method to strip out
3
+ # non-rspec lines. This enables errors to be reported at the call site in
4
+ # the code using the library, which is far more useful than the particular
5
+ # internal method that raised an error.
6
+ class CallerFilter
7
+
8
+ RSPEC_LIBS = %w[
9
+ core
10
+ mocks
11
+ expectations
12
+ support
13
+ matchers
14
+ rails
15
+ ]
16
+
17
+ ADDITIONAL_TOP_LEVEL_FILES = %w[ autorun ]
18
+
19
+ LIB_REGEX = %r{/lib/rspec/(#{(RSPEC_LIBS + ADDITIONAL_TOP_LEVEL_FILES).join('|')})(\.rb|/)}
20
+
21
+ if RUBY_VERSION >= '2.0.0'
22
+ def self.first_non_rspec_line
23
+ # `caller` is an expensive method that scales linearly with the size of
24
+ # the stack. The performance hit for fetching it in chunks is small,
25
+ # and since the target line is probably near the top of the stack, the
26
+ # overall improvement of a chunked search like this is significant.
27
+ #
28
+ # See benchmarks/caller.rb for measurements.
29
+
30
+ # Initial value here is mostly arbitrary, but is chosen to give good
31
+ # performance on the common case of creating a double.
32
+ increment = 5
33
+ i = 1
34
+ line = nil
35
+
36
+ while !line
37
+ stack = caller(i, increment)
38
+ raise "No non-lib lines in stack" unless stack
39
+
40
+ line = stack.find { |l| l !~ LIB_REGEX }
41
+
42
+ i += increment
43
+ increment *= 2 # The choice of two here is arbitrary.
44
+ end
45
+
46
+ line
47
+ end
48
+ else
49
+ # Earlier rubies do not support the two argument form of `caller`. This
50
+ # fallback is logically the same, but slower.
51
+ def self.first_non_rspec_line
52
+ caller.find { |line| line !~ LIB_REGEX }
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,14 @@
1
+ require 'rspec/support/spec/deprecation_helpers'
2
+ require 'rspec/support/spec/stderr_splitter'
3
+
4
+ warning_preventer = $stderr = RSpec::Support::StdErrSplitter.new($stderr)
5
+
6
+ RSpec.configure do |c|
7
+ c.include RSpecHelpers
8
+ c.before do
9
+ warning_preventer.reset!
10
+ end
11
+ c.after do |example|
12
+ warning_preventer.verify_example!(example)
13
+ end
14
+ end
@@ -0,0 +1,29 @@
1
+ module RSpecHelpers
2
+ def expect_deprecation_with_call_site(file, line)
3
+ expect(RSpec.configuration.reporter).to receive(:deprecation) do |options|
4
+ expect(options[:call_site]).to include([file, line].join(':'))
5
+ end
6
+ end
7
+
8
+ def allow_deprecation
9
+ allow(RSpec.configuration.reporter).to receive(:deprecation)
10
+ end
11
+
12
+ def expect_warning_without_call_site(expected = //)
13
+ expect(::Kernel).to receive(:warn) do |message|
14
+ expect(message).to match expected
15
+ expect(message).to_not match(/Called from/)
16
+ end
17
+ end
18
+
19
+ def expect_warning_with_call_site(file, line, expected = //)
20
+ expect(::Kernel).to receive(:warn) do |message|
21
+ expect(message).to match expected
22
+ expect(message).to match(/Called from #{file}:#{line}/)
23
+ end
24
+ end
25
+
26
+ def allow_warning
27
+ allow(::Kernel).to receive(:warn)
28
+ end
29
+ end
@@ -0,0 +1,40 @@
1
+ module RSpec
2
+ module Support
3
+ module InSubProcess
4
+ if Process.respond_to?(:fork) && !(RUBY_PLATFORM == 'java' && RUBY_VERSION == '1.8.7')
5
+ # Useful as a way to isolate a global change to a subprocess.
6
+ def in_sub_process
7
+ readme, writeme = IO.pipe
8
+
9
+ pid = Process.fork do
10
+ exception = nil
11
+ begin
12
+ yield
13
+ rescue Exception => e
14
+ exception = e
15
+ end
16
+
17
+ writeme.write Marshal.dump(exception)
18
+
19
+ readme.close
20
+ writeme.close
21
+ exit! # prevent at_exit hooks from running (e.g. minitest)
22
+ end
23
+
24
+ writeme.close
25
+ Process.waitpid(pid)
26
+
27
+ exception = Marshal.load(readme.read)
28
+ readme.close
29
+
30
+ raise exception if exception
31
+ end
32
+ else
33
+ def in_sub_process
34
+ pending "This spec requires forking to work properly, " +
35
+ "and your platform does not support forking"
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,50 @@
1
+ require 'stringio'
2
+
3
+ module RSpec
4
+ module Support
5
+ class StdErrSplitter < (defined?(::BasicObject) ? ::BasicObject : ::Object)
6
+ def initialize(original)
7
+ @orig_stderr = original
8
+ @output_tracker = ::StringIO.new
9
+ end
10
+
11
+ respond_to_name = (::RUBY_VERSION.to_f < 1.9) ? :respond_to? : :respond_to_missing?
12
+ define_method respond_to_name do |*args|
13
+ @orig_stderr.respond_to?(*args) || super
14
+ end
15
+
16
+ def method_missing(name, *args, &block)
17
+ @output_tracker.__send__(name, *args, &block)
18
+ @orig_stderr.__send__(name, *args, &block)
19
+ end
20
+
21
+ def ==(other)
22
+ @orig_stderr == other
23
+ end
24
+
25
+ # To work around JRuby error:
26
+ # TypeError: $stderr must have write method, RSpec::StdErrSplitter given
27
+ def write(*args)
28
+ @orig_stderr.write(*args)
29
+ @output_tracker.write(*args)
30
+ end
31
+
32
+ def has_output?
33
+ !output.empty?
34
+ end
35
+
36
+ def reset!
37
+ @output_tracker = ::StringIO.new
38
+ end
39
+
40
+ def verify_example!(example)
41
+ example.send(:fail,"Warnings were generated: #{output}") if has_output?
42
+ reset!
43
+ end
44
+
45
+ def output
46
+ @output_tracker.string
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,7 @@
1
+ module RSpec
2
+ module Support
3
+ module Version
4
+ STRING = '3.0.0.beta1'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,41 @@
1
+ module RSpec
2
+
3
+ unless respond_to?(:deprecate)
4
+
5
+ # @private
6
+ #
7
+ # Used internally to print deprecation warnings
8
+ # when rspec-core isn't loaded
9
+ def self.deprecate(deprecated, options = {})
10
+ warn_with "DEPRECATION: #{deprecated} is deprecated.", options
11
+ end
12
+ end
13
+
14
+ unless respond_to?(:warn_deprecation)
15
+
16
+ # @private
17
+ #
18
+ # Used internally to print deprecation warnings
19
+ # when rspec-core isn't loaded
20
+ def self.warn_deprecation(message)
21
+ warn_with "DEPRECATION: \n #{message}"
22
+ end
23
+ end
24
+
25
+ # @private
26
+ #
27
+ # Used internally to print warnings
28
+ def self.warning(text, options={})
29
+ warn_with "WARNING: #{text}.", options
30
+ end
31
+
32
+ # @private
33
+ #
34
+ # Used internally to print longer warnings
35
+ def self.warn_with(message, options = {})
36
+ call_site = options.fetch(:call_site) { CallerFilter.first_non_rspec_line }
37
+ message << " Called from #{call_site}." if call_site
38
+ ::Kernel.warn message
39
+ end
40
+
41
+ end
metadata ADDED
@@ -0,0 +1,132 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rspec-support
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.0.0.beta1
5
+ platform: ruby
6
+ authors:
7
+ - David Chelimsky
8
+ - Myron Marson
9
+ - Jon Rowe
10
+ - Sam Phippen
11
+ - Xaviery Shay
12
+ - Bradley Schaefer
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain:
16
+ - !binary |-
17
+ LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURqakNDQW5hZ0F3SUJB
18
+ Z0lCQVRBTkJna3Foa2lHOXcwQkFRVUZBREJHTVJJd0VBWURWUVFEREFseWMz
19
+ QmwKWXkxa1pYWXhHekFaQmdvSmtpYUprL0lzWkFFWkZndG5iMjluYkdWbmIz
20
+ VndjekVUTUJFR0NnbVNKb21UOGl4awpBUmtXQTJOdmJUQWVGdzB4TXpFeE1E
21
+ Y3hPVFF5TlRsYUZ3MHhOREV4TURjeE9UUXlOVGxhTUVZeEVqQVFCZ05WCkJB
22
+ TU1DWEp6Y0dWakxXUmxkakViTUJrR0NnbVNKb21UOGl4a0FSa1dDMmR2YjJk
23
+ c1pXZHZkWEJ6TVJNd0VRWUsKQ1pJbWlaUHlMR1FCR1JZRFkyOXRNSUlCSWpB
24
+ TkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQQpuaENlWm91
25
+ RExYV081NW5vK0VkWk5DdGpYamZKUTFYOVRiUGN2QkREMjlPeXBJVWNlMmgv
26
+ VmRLWEIyZ0k3WkhzCkY1TmtQZ2dzbFRFckdGbVdBdElpdXI3dTk0M1JWcUhP
27
+ c3lvSXN5MDY1RjlmQ3RyeWtrQSsyMmVsdlREaGE0SXoKUlVDdnVoUTNrbGF0
28
+ WWs0akYrY0d0MWpOT05OVmRMT2l5MGJNeW52Y003aG9WUTJBb213R3MrY0VP
29
+ V1EvNGRrRApKY05WM3FmekY1UUJjVEQyMzcyWE5NNTNiMjVuWVZRU1gyS0g1
30
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11-08 00:00:00.000000000 Z
47
+ dependencies:
48
+ - !ruby/object:Gem::Dependency
49
+ name: bundler
50
+ requirement: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '1.3'
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '1.3'
62
+ - !ruby/object:Gem::Dependency
63
+ name: rake
64
+ requirement: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 10.0.0
69
+ type: :development
70
+ prerelease: false
71
+ version_requirements: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: 10.0.0
76
+ - !ruby/object:Gem::Dependency
77
+ name: rspec
78
+ requirement: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: 3.0.0.pre
83
+ type: :development
84
+ prerelease: false
85
+ version_requirements: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ! '>='
88
+ - !ruby/object:Gem::Version
89
+ version: 3.0.0.pre
90
+ description: Support utilities for RSpec gems
91
+ email: rspec-users@rubyforge.org
92
+ executables: []
93
+ extensions: []
94
+ extra_rdoc_files: []
95
+ files:
96
+ - lib/rspec/support.rb
97
+ - lib/rspec/support/caller_filter.rb
98
+ - lib/rspec/support/spec.rb
99
+ - lib/rspec/support/spec/deprecation_helpers.rb
100
+ - lib/rspec/support/spec/in_sub_process.rb
101
+ - lib/rspec/support/spec/stderr_splitter.rb
102
+ - lib/rspec/support/version.rb
103
+ - lib/rspec/support/warnings.rb
104
+ - README.md
105
+ - License.txt
106
+ - Changelog.md
107
+ homepage: https://github.com/rspec/rspec-support
108
+ licenses:
109
+ - MIT
110
+ metadata: {}
111
+ post_install_message:
112
+ rdoc_options:
113
+ - --charset=UTF-8
114
+ require_paths:
115
+ - lib
116
+ required_ruby_version: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - ! '>='
119
+ - !ruby/object:Gem::Version
120
+ version: 1.8.7
121
+ required_rubygems_version: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ! '>'
124
+ - !ruby/object:Gem::Version
125
+ version: 1.3.1
126
+ requirements: []
127
+ rubyforge_project: rspec
128
+ rubygems_version: 2.0.7
129
+ signing_key:
130
+ specification_version: 4
131
+ summary: rspec-support-3.0.0.beta1
132
+ test_files: []
@@ -0,0 +1 @@
1
+ �8v����2^>-��L��B���<_h�j4�Y�ԋ�b �����*r����H��(@�U��-ݮSu�vP��)\bf�QM\��_�s�rd��,��r#(Ga�i �N<7�A�|J�"$��^Co`�5� |J�7Q ��{��@8ܨ�v�h�c��`!ǻ~���o�8^�j�S�BѺT�.rT���[�ׁZ2� �-���sT=�h#�~�����W�^�s��XW�t~`�&��rҢ��h�