Skip to content
Browse files

Emit deprecation warning for running_example

Note that we set this up only for the "running_example" getter, not the
setter, as the latter should only ever be used internally by RSpec
itself, not by external callers.
  • Loading branch information...
1 parent 39d692b commit c58b90a4a9bf673fe08771bb3d0cdc80957025ea @wincent wincent committed with dchelimsky Jun 17, 2010
Showing with 13 additions and 0 deletions.
  1. +4 −0 lib/rspec/core/example_group.rb
  2. +9 −0 spec/rspec/core/deprecations_spec.rb
View
4 lib/rspec/core/example_group.rb
@@ -8,6 +8,10 @@ class ExampleGroup
attr_accessor :example
+ def running_example
+ RSpec.deprecate('running_example', 'example')
+ end
+
def self.world
RSpec.world
end
View
9 spec/rspec/core/deprecations_spec.rb
@@ -7,4 +7,13 @@
Spec
end
end
+
+ describe RSpec::Core::ExampleGroup do
+ describe 'running_example' do
+ it 'is deprecated' do
+ RSpec.should_receive(:warn_deprecation).with /running_example.*example/m
+ self.running_example
+ end
+ end
+ end
end

0 comments on commit c58b90a

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