Skip to content
Browse files

delegate running_example to example as to deprecate, but not decapitate

  • Loading branch information...
1 parent c58b90a commit 7366e3561043fd901bc3d7b98363bba8343b3deb @dchelimsky dchelimsky committed Jun 17, 2010
Showing with 11 additions and 0 deletions.
  1. +1 −0 lib/rspec/core/example_group.rb
  2. +10 −0 spec/rspec/core/deprecations_spec.rb
View
1 lib/rspec/core/example_group.rb
@@ -10,6 +10,7 @@ class ExampleGroup
def running_example
RSpec.deprecate('running_example', 'example')
+ example
end
def self.world
View
10 spec/rspec/core/deprecations_spec.rb
@@ -6,6 +6,11 @@
RSpec.should_receive(:warn_deprecation).with /Spec .* RSpec/i
Spec
end
+
+ it "returns RSpec" do
+ RSpec.stub(:warn_deprecation)
+ Spec.should == RSpec
+ end
end
describe RSpec::Core::ExampleGroup do
@@ -14,6 +19,11 @@
RSpec.should_receive(:warn_deprecation).with /running_example.*example/m
self.running_example
end
+
+ it "delegates to example" do
+ RSpec.stub(:warn_deprecation)
+ running_example.should == example
+ end
end
end
end

0 comments on commit 7366e35

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