Permalink
Browse files

return the generated example (improved dogfood)

  • Loading branch information...
1 parent 7e22b36 commit 9d044e139ab1d7adefd0dab452264762f3c1dc6c @dchelimsky dchelimsky committed Apr 24, 2010
Showing with 3 additions and 7 deletions.
  1. +1 −0 lib/rspec/core/example_group.rb
  2. +2 −7 spec/rspec/core/example_spec.rb
@@ -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
@@ -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

0 comments on commit 9d044e1

Please sign in to comment.