Module: MacSpec::MatcherSystem::ExpectationBuilder

Defined in:
lib/mac_spec/matcher_system/core/expectation_builder.rb

Class Method Summary collapse

Class Method Details

.build_expectation(match, exp, obj) ⇒ Object



4
5
6
7
8
# File 'lib/mac_spec/matcher_system/core/expectation_builder.rb', line 4

def self.build_expectation(match, exp, obj)
  return MacSpec::MatcherSystem::Expectations::OperatorExpectation.new(obj, match) unless exp

  (exp.matches?(obj) != match) ? MacSpec.flunk(match ? exp.failure_message : exp.negative_failure_message) : MacSpec.assert(true)
end