Class: Sapphire::DSL::ContainsComparison

Inherits:
Comparison show all
Defined in:
lib/sapphire/DSL/Comparisons/ContainsComparison.rb

Instance Attribute Summary

Attributes inherited from Comparison

#item

Instance Method Summary collapse

Methods inherited from Comparison

#CompareWith, #Create, #Evaluate, #Output, #execute, #initialize, #left, #left=, #right, #right=

Constructor Details

This class inherits a constructor from Sapphire::DSL::Comparison

Instance Method Details

#Compare(actual, expected) ⇒ Object



5
6
7
8
# File 'lib/sapphire/DSL/Comparisons/ContainsComparison.rb', line 5

def Compare(actual, expected)
  return @comparator.Compare((actual.include? expected), true) if @comparator != nil
  actual.include? expected
end

#TextObject



10
11
12
13
# File 'lib/sapphire/DSL/Comparisons/ContainsComparison.rb', line 10

def Text
  return @comparator.Text + " to contain" if @comparator != nil
  " to contain"
end