module RSpec::SleepingKingStudios::Examples::PropertyExamples

Pregenerated example groups for testing the presence and value of reader and writer methods.

Constants

UNDEFINED_VALUE_EXPECTATION

@api private

Internal object used to differentiate a nil expectation from a default value expectation.

Private Instance Methods

format_expected_value(expected_value) click to toggle source
# File lib/rspec/sleeping_king_studios/examples/property_examples.rb, line 24
        def format_expected_value expected_value
  if expected_value.is_a?(Proc)
    object_tools = SleepingKingStudios::Tools::ObjectTools

    if 0 == expected_value.arity
      comparable_value = object_tools.apply self, expected_value
    else
      comparable_value = satisfy do |actual_value|
        object_tools.apply self, expected_value, actual_value
      end # satisfy
    end # if-else
  else
    comparable_value = expected_value
  end # if

  comparable_value
end