Class: Lookout::Expected::Array

Inherits:
Object show all
Defined in:
lib/lookout-3.0/expected/array.rb

Overview

Represents expected Arrays.

Instance Method Summary collapse

Methods inherited from Object

#expect

Instance Method Details

#difference(actual) ⇒ Difference::Array?

Returns A difference report between ACTUAL and #expected unless their content exhibit no differences.

Parameters:

Returns:



8
9
10
11
12
13
14
15
# File 'lib/lookout-3.0/expected/array.rb', line 8

def difference(actual)
  Lookout::Difference::Array.new(actual, expected) unless
    Array === actual and
    expected.size == actual.size and
    expected.enum_for(:none?).with_index{ |v, i|
      v.to_lookout_expected.difference(actual[i])
    }
end