Browse files

add examples for deprecated Example#example and Example#running_example

  • Loading branch information...
1 parent aab3c4d commit ed5a3be0f2e8a0bd82f324bd90f99591ac55fc94 @dchelimsky dchelimsky committed Jun 19, 2013
Showing with 14 additions and 0 deletions.
  1. +14 −0 spec/rspec/core/example_spec.rb
View
14 spec/rspec/core/example_spec.rb
@@ -443,4 +443,18 @@ def run_and_capture_reported_message(group)
expect(ex.description).to match(/contains the example/)
end
end
+
+ %w[example running_example].each do |accessor|
+ describe accessor do
+ it "is deprecated" do
+ expect(RSpec).to receive(:deprecate)
+ send(accessor)
+ end
+
+ it "returns the current running example" do |ex|
+ allow(RSpec).to receive(:deprecate)
+ expect(send(accessor)).to eq ex
+ end
+ end
+ end
end

0 comments on commit ed5a3be

Please sign in to comment.