Files

Caricature::ExpectationSyntax

contains the syntax for building up an expectation This is shared between the ExpecationBuilder and the Expectation

Public Instance Methods

actual_raise(*args) click to toggle source

Alias for raise

any_args?() click to toggle source

indicates whether this expectation should match with any arguments or only for the specified arguments

    # File lib/caricature/expectation.rb, line 75
75:     def any_args?
76:       @any_args
77:     end
raise(*args) click to toggle source

(Not documented)

    # File lib/caricature/expectation.rb, line 58
58:     def raise(*args)
59:       @error_args = args
60:       self
61:     end
Also aliased as: actual_raise
return(value=nil) click to toggle source

tell the expectation it nees to return this value or the value returned by the block you provide to this method.

    # File lib/caricature/expectation.rb, line 50
50:     def return(value=nil)
51:       @return_value = value
52:       @return_value ||= yield if block_given?
53:       self
54:     end
super_after() click to toggle source

tell the expectation it needs to call the super after the expecation execution

    # File lib/caricature/expectation.rb, line 69
69:     def super_after
70:       @super = :after
71:     end
super_before() click to toggle source

tell the expecation it needs to call the super before the expectation exectution

    # File lib/caricature/expectation.rb, line 64
64:     def super_before
65:       @super = :before
66:     end
with(*args, &b) click to toggle source

tell the expection which arguments it needs to respond to there is a magic argument here any which configures the expectation to respond to any arguments

    # File lib/caricature/expectation.rb, line 41
41:     def with(*args, &b)
42:       @any_args = args.first.is_a?(Symbol) and args.first == :any
43:       @args = args   
44:       @callback = b unless b.nil?
45:       self
46:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.