class TestBench::Controls::KernelSubstitute

Attributes

file_map[R]

Public Class Methods

example(file_map=nil) click to toggle source
# File lib/test_bench/controls/kernel_substitute.rb, line 4
def self.example file_map=nil
  file_map ||= FileMap.example

  instance = new file_map
  instance
end
new(file_map) click to toggle source
# File lib/test_bench/controls/kernel_substitute.rb, line 13
def initialize file_map
  @file_map = file_map
end

Public Instance Methods

load(path) click to toggle source
# File lib/test_bench/controls/kernel_substitute.rb, line 17
def load path
  ruby_text = file_map[path]

  TOPLEVEL_BINDING.eval ruby_text, path
end