Module: Pry::Testable

Extended by:
Testable
Included in:
Testable
Defined in:
lib/pry/testable.rb

Defined Under Namespace

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

Constant Summary

TEST_DEFAULTS =
{
  color: false,
  pager: false,
  should_load_rc: false,
  should_load_local_rc: false,
  correct_indent: false,
  collison_warning: false,
  history: {
    should_load: false,
    should_save: false
  }
}

Class Method Summary collapse

Class Method Details

.included(mod)

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.



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

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_variables

This method returns an undefined value.

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



57
58
59
60
# File 'lib/pry/testable.rb', line 57

def self.set_testenv_variables
  Pry.config = Pry::Config.from_hash(TEST_DEFAULTS, Pry::Config::Default.new)
  Pry.config.hooks = Pry::Hooks.new
end

.unset_testenv_variables

This method returns an undefined value.

Reset the Pry configuration to their default values.



67
68
69
# File 'lib/pry/testable.rb', line 67

def self.unset_testenv_variables
  Pry.config = Pry::Config.from_hash({}, Pry::Config::Default.new)
end