Skip to content

Commit

Permalink
add examples for deprecated Example#example and Example#running_example
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Jun 19, 2013
1 parent aab3c4d commit ed5a3be
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spec/rspec/core/example_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.