Module: Pry::Testable

Defined in:
lib/pry/testable.rb,
lib/pry/testable/utility.rb,
lib/pry/testable/evalable.rb,
lib/pry/testable/mockable.rb,
lib/pry/testable/variables.rb,
lib/pry/testable/pry_tester.rb

Defined Under Namespace

Modules: Evalable, Mockable, Utility, Variables Classes: PryTester

Class Method Summary collapse

Class Method Details

.included(mod) ⇒ void

Note:

Each of the included modules mentioned above may also be used standalone or in a pick-and-mix fashion.

This method returns an undefined value.

When Pry::Testable is included into another module or class, the following modules are also included: Mockable, Evalable, Variables, and Utility.

Parameters:

  • mod (Module)

    A class or module.



30
31
32
33
34
35
36
37
# File 'lib/pry/testable.rb', line 30

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

.set_testenv_variablesvoid

This method returns an undefined value.

Sets various configuration options that make Pry optimal for a test environment, see source code for complete details.



45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/pry/testable.rb', line 45

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

.unset_testenv_variablesvoid

This method returns an undefined value.

Reset the Pry configuration to their default values.



64
65
66
# File 'lib/pry/testable.rb', line 64

def self.unset_testenv_variables
  Pry.config = Pry::Config.new
end