Class: Specdiff::Differ::NotFound

Inherits:
Object
  • Object
show all
Defined in:
lib/specdiff/differ/not_found.rb

Overview

this is the null differ

Class Method Summary collapse

Class Method Details

._representation_for(side) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/specdiff/differ/not_found.rb', line 13

def self._representation_for(side)
  if side.type == :binary
    "<binary content>"
  else
    side.value.inspect
  end
end

.diff(a, b) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/specdiff/differ/not_found.rb', line 3

def self.diff(a, b)
  comparison = "!="
  comparison = "==" if a.value == b.value

  a_representation = _representation_for(a)
  b_representation = _representation_for(b)

  "#{a_representation} #{comparison} #{b_representation}"
end

.stringify(diff) ⇒ Object



21
22
23
# File 'lib/specdiff/differ/not_found.rb', line 21

def self.stringify(diff)
  diff.raw
end