Module: DhEasy::Core::Mock
- Defined in:
- lib/dh_easy/core/mock.rb,
lib/dh_easy/core/mock/fake_db.rb,
lib/dh_easy/core/mock/fake_parser.rb,
lib/dh_easy/core/mock/fake_seeder.rb,
lib/dh_easy/core/mock/fake_executor.rb,
lib/dh_easy/core/mock/fake_finisher.rb
Defined Under Namespace
Modules: FakeExecutor Classes: FakeDb, FakeFinisher, FakeParser, FakeSeeder
Class Method Summary collapse
-
.context_vars(exposed_methods) ⇒ Array
Generate a context and message queue from a list of exposed methods.
Class Method Details
.context_vars(exposed_methods) ⇒ Array
Generate a context and message queue from a list of exposed methods.
30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/dh_easy/core/mock.rb', line 30 def self.context_vars exposed_methods context = Object.new = class << context; self; end = [] # Beat reference bug exposed_methods = exposed_methods exposed_methods.each do |key| .send(:define_method, key) do |*args| # Record all method calls into message queue for easy access << [key, args] end end [context, ] end |