rspec-core 2.14.1 → 2.14.2

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.
@@ -1,10 +1,24 @@
1
+ ### 2.14.2 / 2013-07-09
2
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.14.1...v2.14.2)
3
+
4
+ Bug fixes
5
+
6
+ * Fix regression caused by 2.14.1 release: formatters that
7
+ report that they `respond_to?` a notification, but had
8
+ no corresponding method would raise an error when registered.
9
+ The new fix is to just implement `start` on the deprecation
10
+ formatter to fix the original JRuby/ruby-debug issue.
11
+ (Jon Rowe)
12
+
1
13
  ### 2.14.1 / 2013-07-08
2
14
  [full changelog](http://github.com/rspec/rspec-core/compare/v2.14.0...v2.14.1)
3
15
 
4
16
  Bug fixes
5
17
 
6
- * Implement `#start` on the Deprecation Formatter to prevent collision with
7
- `ruby-debug` on JRuby (Alex Portnov, Jon Rowe)
18
+ * Address deprecation formatter failure when using `ruby-debug` on
19
+ JRuby: fix `RSpec::Core::Reporter` to not send a notification
20
+ when the formatter's implementation of the notification method
21
+ comes from `Kernel` (Alex Portnov, Jon Rowe).
8
22
 
9
23
  ### 2.14.0 / 2013-07-06
10
24
  [full changelog](http://github.com/rspec/rspec-core/compare/v2.14.0.rc1...v2.14.0)
@@ -8,6 +8,10 @@ module RSpec
8
8
  @count = 0
9
9
  end
10
10
 
11
+ def start(example_count=nil)
12
+ #no-op to fix #966
13
+ end
14
+
11
15
  def deprecation(data)
12
16
  @count += 1
13
17
  if data[:message]
@@ -21,7 +21,7 @@ module RSpec::Core
21
21
  # events to all registered listeners
22
22
  def register_listener(listener, *notifications)
23
23
  notifications.each do |notification|
24
- @listeners[notification.to_sym] << listener if understands(listener, notification)
24
+ @listeners[notification.to_sym] << listener if listener.respond_to?(notification)
25
25
  end
26
26
  true
27
27
  end
@@ -128,18 +128,5 @@ module RSpec::Core
128
128
  end
129
129
  end
130
130
 
131
- private
132
- if Method.method_defined?(:owner) # 1.8.6 lacks Method#owner
133
- def understands(listener, notification)
134
- listener.respond_to?(notification) && listener.method(notification).owner != ::Kernel
135
- end
136
- else
137
- def understands(listener, notification)
138
- # Hack for 1.8.6
139
- # {}.method(:=~).to_s # => "#<Method: Hash(Kernel)#=~>"
140
- listener.respond_to?(notification) && !listener.method(notification).to_s.include('(Kernel)')
141
- end
142
- end
143
-
144
131
  end
145
132
  end
@@ -1,7 +1,7 @@
1
1
  module RSpec
2
2
  module Core
3
3
  module Version
4
- STRING = '2.14.1'
4
+ STRING = '2.14.2'
5
5
  end
6
6
  end
7
7
  end
@@ -4,12 +4,29 @@ require 'tempfile'
4
4
 
5
5
  module RSpec::Core::Formatters
6
6
  describe DeprecationFormatter do
7
+ let(:deprecation_stream) { StringIO.new }
8
+ let(:summary_stream) { StringIO.new }
9
+ let(:formatter) { DeprecationFormatter.new deprecation_stream, summary_stream }
7
10
 
8
- describe "#deprecation" do
9
- let(:deprecation_stream) { StringIO.new }
10
- let(:summary_stream) { StringIO.new }
11
- let(:formatter) { DeprecationFormatter.new deprecation_stream, summary_stream }
11
+ def with_start_defined_on_kernel
12
+ return yield if ::Kernel.method_defined?(:start)
13
+
14
+ begin
15
+ ::Kernel.module_eval { def start(*); raise "boom"; end }
16
+ yield
17
+ ensure
18
+ ::Kernel.module_eval { undef start }
19
+ end
20
+ end
12
21
 
22
+ it 'does not blow up when `Kernel` defines `start`' do
23
+ with_start_defined_on_kernel do
24
+ reporter = ::RSpec::Core::Reporter.new(formatter)
25
+ reporter.start(3)
26
+ end
27
+ end
28
+
29
+ describe "#deprecation" do
13
30
  it "includes the method" do
14
31
  formatter.deprecation(:deprecated => "i_am_deprecated")
15
32
  deprecation_stream.rewind
@@ -120,28 +120,6 @@ module RSpec::Core
120
120
  end
121
121
  end
122
122
 
123
- describe 'when message implemented on kernel' do
124
- def with_message_defined_on_kernel
125
- return yield if ::Kernel.method_defined?(:start)
126
-
127
- begin
128
- ::Kernel.module_eval { def start(*); raise "boom"; end }
129
- yield
130
- ensure
131
- ::Kernel.module_eval { undef start }
132
- end
133
- end
134
-
135
- let(:formatter) { double("formatter") }
136
-
137
- it 'does not blow up when `Kernel` defines message instead of a formatter' do
138
- with_message_defined_on_kernel do
139
- reporter = ::RSpec::Core::Reporter.new(formatter)
140
- reporter.start(3)
141
- end
142
- end
143
- end
144
-
145
123
  describe "timing" do
146
124
  it "uses RSpec::Core::Time as to not be affected by changes to time in examples" do
147
125
  formatter = double(:formatter)
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rspec-core
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 2.14.1
5
+ version: 2.14.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Steven Baker
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2013-07-09 00:00:00.000000000 Z
14
+ date: 2013-07-10 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  version_requirements: !ruby/object:Gem::Requirement
@@ -383,7 +383,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
383
383
  version: '0'
384
384
  segments:
385
385
  - 0
386
- hash: 3036495542605689821
386
+ hash: 2476861130541035807
387
387
  none: false
388
388
  required_rubygems_version: !ruby/object:Gem::Requirement
389
389
  requirements:
@@ -392,14 +392,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
392
392
  version: '0'
393
393
  segments:
394
394
  - 0
395
- hash: 3036495542605689821
395
+ hash: 2476861130541035807
396
396
  none: false
397
397
  requirements: []
398
398
  rubyforge_project: rspec
399
399
  rubygems_version: 1.8.24
400
400
  signing_key:
401
401
  specification_version: 3
402
- summary: rspec-core-2.14.1
402
+ summary: rspec-core-2.14.2
403
403
  test_files:
404
404
  - features/Autotest.md
405
405
  - features/README.md