2008-06-18 02:57:57 -04:00
|
|
|
module Spec
|
|
|
|
|
module Example
|
|
|
|
|
# Base class for customized example groups. Use this if you
|
|
|
|
|
# want to make a custom example group.
|
|
|
|
|
class ExampleGroup
|
|
|
|
|
extend Spec::Example::ExampleGroupMethods
|
|
|
|
|
include Spec::Example::ExampleMethods
|
|
|
|
|
|
2008-11-29 12:00:06 -05:00
|
|
|
def initialize(defined_description, options={}, &implementation)
|
|
|
|
|
@_options = options
|
2008-06-18 02:57:57 -04:00
|
|
|
@_defined_description = defined_description
|
2008-11-29 12:00:06 -05:00
|
|
|
@_implementation = implementation || pending_implementation
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
|
|
def pending_implementation
|
|
|
|
|
error = NotYetImplementedError.new(caller)
|
|
|
|
|
lambda { raise(error) }
|
2008-06-18 02:57:57 -04:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
Spec::ExampleGroup = Spec::Example::ExampleGroup
|