Module: Spec::Runner::ContextEval::ModuleMethods
- Defined in:
- lib/spec/runner/context_eval.rb
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object
33
34
35
36
37
38
|
# File 'lib/spec/runner/context_eval.rb', line 33
def method_missing(method_name, *args)
if context_superclass.respond_to?(method_name)
return execution_context_class.send(method_name, *args)
end
super
end
|
Instance Method Details
#include(mod) ⇒ Object
10
11
12
|
# File 'lib/spec/runner/context_eval.rb', line 10
def include(mod)
context_modules << mod
end
|
#inherit(klass) ⇒ Object
5
6
7
8
|
# File 'lib/spec/runner/context_eval.rb', line 5
def inherit(klass)
@context_superclass = klass
derive_execution_context_class_from_context_superclass
end
|
26
27
28
29
30
|
# File 'lib/spec/runner/context_eval.rb', line 26
def methods
my_methods = super
my_methods |= context_superclass.methods
my_methods
end
|
#setup(&block) ⇒ Object
14
15
16
|
# File 'lib/spec/runner/context_eval.rb', line 14
def setup(&block)
setup_parts << block
end
|
#specify(spec_name, &block) ⇒ Object
22
23
24
|
# File 'lib/spec/runner/context_eval.rb', line 22
def specify(spec_name, &block)
specifications << Specification.new(spec_name, &block)
end
|
#teardown(&block) ⇒ Object
18
19
20
|
# File 'lib/spec/runner/context_eval.rb', line 18
def teardown(&block)
teardown_parts << block
end
|