describe(*args, &example_group_block)
public
Makes the describe/it syntax available from a class. For example:
class StackSpec < Spec::ExampleGroup
describe Stack, "with no elements"
before
@stack = Stack.new
end
it "should raise on pop" do
lambda{ @stack.pop }.should raise_error
end
end
Show source
def describe(*args, &example_group_block)
raise Spec::Example::NoDescriptionError.new("example group", caller(0)[1]) if args.empty?
if example_group_block
options = add_options(args)
set_location(options, caller(0)[1])
if options[:shared]
ExampleGroupFactory.create_shared_example_group(*args, &example_group_block)
else
subclass(*args, &example_group_block)
end
else
set_description(*args)
end
end