lib/spec/example/example_group_methods.rb in dchelimsky-rspec-1.1.99.9 vs lib/spec/example/example_group_methods.rb in dchelimsky-rspec-1.1.99.13
- old
+ new
@@ -70,11 +70,16 @@
# Creates an instance of the current example group class and adds it to
# a collection of examples of the current example group.
def example(description=nil, options={}, backtrace=nil, &implementation)
example_description = ExampleDescription.new(description, options, backtrace || caller(0)[1])
example_descriptions << example_description
- example_implementations[example_description] = implementation
+ example_implementations[example_description] = implementation || pending_implementation
example_description
+ end
+
+ def pending_implementation
+ error = Spec::Example::NotYetImplementedError.new(caller)
+ lambda { raise(error) }
end
alias_method :it, :example
alias_method :specify, :example