Included Modules

Class Index [+]

Quicksearch

Spec::Example::ExampleMethods

Public Class Methods

new(example_proxy, &implementation) click to toggle source
     # File lib/spec/example/example_methods.rb, line 115
115:       def initialize(example_proxy, &implementation)
116:         @_proxy = example_proxy
117:         @_implementation = implementation
118:         @_backtrace = caller
119:       end

Public Instance Methods

description() click to toggle source

Declared description for this example:

  describe Account do
    it "should start with a balance of 0" do
    ...

  description
  => "should start with a balance of 0"
    # File lib/spec/example/example_methods.rb, line 20
20:       def description
21:         if description = @_proxy.description || ::Spec::Matchers.generated_description
22:           description
23:         else
24:           Spec.warn Spec::Example::NoDescriptionError.message("example", @_proxy.location)
25:         end
26:       end
expect(&block) click to toggle source

Extends the submitted block with aliases to and to_not for should and should_not. Allows expectations like this:

  expect { this_block }.to change{this.expression}.from(old_value).to(new_value)
  expect { this_block }.to raise_error
    # File lib/spec/example/example_methods.rb, line 69
69:       def expect(&block)
70:         block.extend BlockAliases
71:       end
run_after_each() click to toggle source

Run all the after(:each) blocks for this example

     # File lib/spec/example/example_methods.rb, line 111
111:       def run_after_each
112:         example_group_hierarchy.run_after_each(self)
113:       end
run_before_each() click to toggle source

Run all the before(:each) blocks for this example

     # File lib/spec/example/example_methods.rb, line 106
106:       def run_before_each
107:         example_group_hierarchy.run_before_each(self)
108:       end
violated(message="") click to toggle source
    # File lib/spec/example/example_methods.rb, line 8
 8:       def violated(message="")
 9:         raise Spec::Expectations::ExpectationNotMetError.new(message)
10:       end

Private Instance Methods

after_each_example() click to toggle source
     # File lib/spec/example/example_methods.rb, line 131
131:       def after_each_example
132:         run_after_each
133:         verify_mocks_for_rspec
134:       ensure
135:         teardown_mocks_for_rspec
136:       end
before_each_example() click to toggle source
     # File lib/spec/example/example_methods.rb, line 126
126:       def before_each_example
127:         setup_mocks_for_rspec
128:         run_before_each
129:       end
described_class() click to toggle source
     # File lib/spec/example/example_methods.rb, line 138
138:       def described_class
139:         self.class.described_class
140:       end
description_args() click to toggle source
     # File lib/spec/example/example_methods.rb, line 142
142:       def description_args
143:         self.class.description_args
144:       end
example_group_hierarchy() click to toggle source
     # File lib/spec/example/example_methods.rb, line 146
146:       def example_group_hierarchy
147:         self.class.example_group_hierarchy
148:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.