Sha256: a18416c7a723b7fee723fae367ccf5faf73f3d734262f41702b94a9343957005

Contents?: true

Size: 681 Bytes

Versions: 1

Compression:

Stored size: 681 Bytes

Contents

# frozen_string_literal: true

module RSpec
  module Tabular
    # This class is a wrapper around a proc that will indicate
    # to tabular that the provided proc should be run against
    # a spec's context such that variables defined with let and
    # helper methods like instance_double are available.
    #
    # This class should not be called directly. Instead use the
    # helper function `with_context`
    class Wrapped
      def initialize(proc, pretty_val = nil)
        @proc       = proc
        @pretty_val = pretty_val
      end

      attr_reader :proc

      def to_s
        @pretty_val || 'wrapped_value'
      end

      alias inspect to_s
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rspec-tabular-0.3.0 lib/rspec/tabular/wrapped.rb