# frozen_string_literal: true require_relative "shared" require_relative File.join("..", "expectation_target") module RSpec module Clone module ExpectationHelper # {RSpec::Clone::Dsl.it}'s expectation helper module. module It include Shared # Create an expectation for a spec. # # @param value [#object_id, nil] An actual value. # @param block [#call, nil] A code to evaluate. # # @return [Block, Value] The wrapped target of an expectation. # # @example # expect("foo") # => # # expect { RSpec::Clone::Boom! } # => #> # # @api public def expect(value = self.class.superclass, &block) ExpectationTarget.call(self.class.superclass, value, block) end # Wraps the target of an expectation with the subject as actual value. # # @return [Block] The wrapped target of an expectation. # # @example # is_expected # => #> # # @api public def is_expected expect { subject } end end end end end