Caricature::ExpectationSyntax

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

Public Instance Methods

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 71
    def any_args?
      @any_args
    end
raise(*args) click to toggle source

tell the expectation it needs to raise an error with the specified arguments

# File lib/caricature/expectation.rb, line 54
    def raise(*args)
      @error_args = args
      self
    end
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 47
    def return(value=nil)
      @return_value = value
      @return_value ||= yield if block_given?
      self
    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 65
    def super_after
      @super = :after
    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 60
    def super_before
      @super = :before
    end
with(*args) 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 39
    def with(*args)
      @any_args = false unless args.first == :any
      @args = args
      self
    end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.