Sha256: 0f6840a3a464de2d645ac701006a17672a108d24b7f43576b048616bd75d0a7b

Contents?: true

Size: 1.08 KB

Versions: 8

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

require_relative "base"

module RSpec
  module Clone
    module ExpectationTarget
      # Wraps the target of an expectation with a value.
      #
      # @example
      #   expect(something) # => ExpectationTarget::Value wrapping something
      #
      #   # used with `to`
      #   expect(actual).to be(42)
      #
      #   # with `not_to`
      #   expect(actual).not_to be(4)
      #
      # @note `RSpec::Clone::ExpectationTarget::Value` is not intended to be
      #   instantiated directly by users. Use `expect` instead.
      class Value < Base
        protected

        # @param matcher  [#matches?] The matcher.
        # @param negate   [Boolean]   The assertion is positive or negative.
        #
        # @return (see Base#absolute_requirement)
        #
        # @raise (see Base#absolute_requirement)
        def absolute_requirement(matcher:, negate:)
          super(
            ::TestTube.pass(@input, matcher: matcher, negate: negate),
            matcher: matcher,
            negate:  negate
          )
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
r_spec-clone-1.7.0 lib/r_spec/clone/expectation_target/value.rb
r_spec-clone-1.6.0 lib/r_spec/clone/expectation_target/value.rb
r_spec-clone-1.5.0 lib/r_spec/clone/expectation_target/value.rb
r_spec-clone-1.4.0 lib/r_spec/clone/expectation_target/value.rb
r_spec-clone-1.3.0 lib/r_spec/clone/expectation_target/value.rb
r_spec-clone-1.2.4 lib/r_spec/clone/expectation_target/value.rb
r_spec-clone-1.2.3 lib/r_spec/clone/expectation_target/value.rb
r_spec-clone-1.2.2 lib/r_spec/clone/expectation_target/value.rb