Sha256: bdc471c3fa5b63dd6a453bdac4c6a8d249070e7086c05facd334da60d1100117

Contents?: true

Size: 1.77 KB

Versions: 7165

Compression:

Stored size: 1.77 KB

Contents

# frozen_string_literal: true

# good idea ???
# if you're testing pry plugin you should require pry by yourself, no?
require 'pry' unless defined?(Pry)

class Pry
  module Testable
    require_relative "testable/pry_tester"
    require_relative "testable/evalable"
    require_relative "testable/mockable"
    require_relative "testable/variables"
    require_relative "testable/utility"

    #
    # When {Pry::Testable} is included into another module or class,
    # the following modules are also included: {Pry::Testable::Mockable},
    # {Pry::Testable::Evalable}, {Pry::Testable::Variables}, and
    # {Pry::Testable::Utility}.
    #
    # @note
    #   Each of the included modules mentioned above may also be used
    #   standalone or in a pick-and-mix fashion.
    #
    # @param [Module] mod
    #   A class or module.
    #
    # @return [void]
    #
    def self.included(mod)
      mod.module_eval do
        include Pry::Testable::Mockable
        include Pry::Testable::Evalable
        include Pry::Testable::Variables
        include Pry::Testable::Utility
      end
    end

    #
    # Sets various configuration options that make Pry optimal for a test
    # environment, see source code for complete details.
    #
    # @return [void]
    #
    def self.set_testenv_variables
      Pry.config = Pry::Config.new.merge(
        color: false,
        pager: false,
        should_load_rc: false,
        should_load_local_rc: false,
        correct_indent: false,
        collision_warning: false,
        history_save: false,
        history_load: false,
        hooks: Pry::Hooks.new
      )
    end

    #
    # Reset the Pry configuration to their default values.
    #
    # @return [void]
    #
    def self.unset_testenv_variables
      Pry.config = Pry::Config.new
    end
  end
end

Version data entries

7,165 entries across 7,160 versions & 34 rubygems

Version Path
cybrid_api_id_ruby-0.123.310 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/testable.rb
cybrid_api_bank_ruby-0.123.310 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/testable.rb
cybrid_api_organization_ruby-0.123.310 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/testable.rb
cybrid_api_organization_ruby-0.123.309 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/testable.rb
cybrid_api_bank_ruby-0.123.309 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/testable.rb
cybrid_api_id_ruby-0.123.309 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/testable.rb
cybrid_api_bank_ruby-0.123.307 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/testable.rb
cybrid_api_organization_ruby-0.123.307 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/testable.rb
cybrid_api_id_ruby-0.123.307 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/testable.rb
cybrid_api_bank_ruby-0.123.306 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/testable.rb
cybrid_api_id_ruby-0.123.306 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/testable.rb
cybrid_api_organization_ruby-0.123.306 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/testable.rb
cybrid_api_bank_ruby-0.123.305 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/testable.rb
cybrid_api_id_ruby-0.123.305 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/testable.rb
cybrid_api_organization_ruby-0.123.305 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/testable.rb
cybrid_api_organization_ruby-0.123.303 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/testable.rb
cybrid_api_bank_ruby-0.123.303 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/testable.rb
cybrid_api_id_ruby-0.123.303 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/testable.rb
cybrid_api_bank_ruby-0.123.302 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/testable.rb
cybrid_api_organization_ruby-0.123.302 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/testable.rb