Method: Expectations::Expectation#initialize

Defined in:
lib/expectations/expectation.rb

#initialize(expected, file, line, &block) ⇒ Expectation

Returns a new instance of Expectation.



5
6
7
8
9
10
11
12
# File 'lib/expectations/expectation.rb', line 5

def initialize(expected, file, line, &block)
  self.expected, self.block = expected, block
  self.file, self.line = file, line.to_i
  case
    when expected.is_a?(Expectations::Recorder) then extend(Expectations::RecordedExpectation)
    else extend(Expectations::StateBasedExpectation)
  end
end