Module | Spec::Example::ExampleGroupMethods
In: | lib/spec/example/example_group_methods.rb

### Methods

context create_nested_example_group create_shared_example_group describe described_type description description_args description_text example inherited it it_should_behave_like predicate_matchers register registration_backtrace run run_after_each run_before_each set_description specify xexample xit xspecify

### Included Modules

Spec::Example::BeforeAndAfterHooks Spec::Plugins::MockFramework

### External Aliases

description_options | -> | options

### Attributes

description_options | [R] |
description_text | [R] |
matcher_class | [RW] |
spec_path | [R] |

### Public Class methods

description_text(*args)

### Public Instance methods

context(*args, &example_group_block)

Alias for describe

create_nested_example_group(args, example_group_block)
create_shared_example_group(args, example_group_block)
describe(*args, &example_group_block)

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

described_type()
description()
description_args()
example(description=nil, options={}, &implementation)

Creates an instance of the current example group class and adds it to a collection of examples of the current example group.

inherited(klass)
it(description=nil, options={}, &implementation)

Alias for example

it_should_behave_like(*shared_example_groups)

Use this to pull in examples from shared example groups. See Spec::Runner for information about shared example groups.

predicate_matchers[matcher_name] = method_on_object
predicate_matchers[matcher_name] = [method1_on_object, method2_on_object]

Dynamically generates a custom matcher that will match a predicate on your class. RSpec provides a couple of these out of the box:

      exist (or state expectations)
        File.should exist("path/to/file")

      an_instance_of (for mock argument constraints)
        mock.should_receive(:message).with(an_instance_of(String))

## Examples

      class Fish
        def can_swim?
          true
        end
      end

      describe Fish do
        predicate_matchers[:swim] = :can_swim?
        it "should swim" do
          Fish.new.should swim
        end
      end

register(&registration_binding_block)
registration_backtrace()
run()
run_after_each(example)
run_before_each(example)
set_description(*args)
specify(description=nil, options={}, &implementation)

Alias for example

xexample(description=nil, opts={}, &block)

Use this to temporarily disable an example.

xit(description=nil, opts={}, &block)

Alias for xexample

xspecify(description=nil, opts={}, &block)

Alias for xexample

[Validate]