Module: AeEasy::Core::Mock
- Defined in:
- lib/ae_easy/core/mock.rb,
lib/ae_easy/core/mock/fake_db.rb,
lib/ae_easy/core/mock/fake_parser.rb,
lib/ae_easy/core/mock/fake_seeder.rb,
lib/ae_easy/core/mock/fake_executor.rb
Defined Under Namespace
Modules: FakeExecutor Classes: FakeDb, 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.
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/ae_easy/core/mock.rb', line 29 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 |