Class: Class
- Inherits:
-
Object
- Object
- Class
- Defined in:
- lib/rspec/mocks/syntax.rb
Overview
The legacy :should
syntax adds the any_instance
to Class
.
We generally recommend you use the newer :expect
syntax instead,
which allows you to stub any instance of a class using
allow_any_instance_of(klass)
or mock any instance using
expect_any_instance_of(klass)
.
Instance Method Summary (collapse)
-
- (Recorder) any_instance
Used to set stubs and message expectations on any instance of a given class.
Instance Method Details
- (Recorder) any_instance
Note:
This is only available when you have enabled the should
syntax.
Used to set stubs and message expectations on any instance of a given
class. Returns a Recorder, which records messages like
stub
and should_receive
for later playback on instances of the
class.
|
# File 'lib/rspec/mocks/syntax.rb', line 329
|