Method: Spec::Example::ExampleMethods#expect

Defined in:
lib/spec/example/example_methods.rb

#expect(&block) ⇒ Object

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


65
66
67
# File 'lib/spec/example/example_methods.rb', line 65

def expect(&block)
  block.extend BlockAliases
end