Skip to content

Commit

Permalink
return the generated example (improved dogfood)
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Apr 24, 2010
1 parent 7e22b36 commit 9d044e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
1 change: 1 addition & 0 deletions lib/rspec/core/example_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def self.#{name}(desc=nil, options={}, &block)
options.update(:caller => caller)
options.update(#{extra_options.inspect})
examples << Rspec::Core::Example.new(self, desc, options, block)
examples.last
end
END_RUBY
end
Expand Down
9 changes: 2 additions & 7 deletions spec/rspec/core/example_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,11 @@

describe Rspec::Core::Example, :parent_metadata => 'sample' do
let(:example_group) do
stub('example_group',
:metadata => Rspec::Core::Metadata.new.process(
'group description',
:caller => ['foo_spec.rb:37']
)
).as_null_object
Rspec::Core::ExampleGroup.describe('group description')
end

let(:example) do
Rspec::Core::Example.new(example_group, 'example description', {}, (lambda {}))
example_group.example('example description')
end

describe "attr readers" do
Expand Down

0 comments on commit 9d044e1

Please sign in to comment.