Skip to content

Commit

Permalink
deprecate example.behaviour
Browse files Browse the repository at this point in the history
dchelimsky committed Jun 29, 2010
1 parent 3dd3de5 commit 171fad4
Showing 2 changed files with 8 additions and 20 deletions.
5 changes: 4 additions & 1 deletion lib/rspec/core/example.rb
Original file line number Diff line number Diff line change
@@ -30,7 +30,10 @@ def in_block?
@in_block
end

alias_method :behaviour, :example_group
def behaviour
RSpec.deprecate("behaviour", "example_group")
example_group
end

def run(example_group_instance, reporter)
start
23 changes: 4 additions & 19 deletions spec/rspec/core/example_spec.rb
Original file line number Diff line number Diff line change
@@ -9,25 +9,10 @@
example_group.example('example description')
end

describe "attr readers" do
it "should have one for the parent example group" do
example_instance.should respond_to(:example_group)
end

it "should have one for its description" do
example_instance.should respond_to(:description)
end

it "should have one for its metadata" do
example_instance.should respond_to(:metadata)
end

it "should have one for its block" do
example_instance.should respond_to(:example_block)
end

it "should have one for its options" do
example_instance.should respond_to(:options)
describe "#behaviour" do
it "is deprecated" do
RSpec.should_receive(:deprecate)
example_instance.behaviour
end
end

0 comments on commit 171fad4

Please sign in to comment.