Class: Spectroscope::Example::Scope
- Defined in:
- lib/spectroscope/example.rb
Overview
Example::Scope is used by Context to create a shared scope for running examples.
Instance Method Summary collapse
-
#initialize(group) ⇒ Scope
constructor
A new instance of Scope.
- #pending(message = nil) ⇒ Object
- #subject ⇒ Object
Constructor Details
#initialize(group) ⇒ Scope
Returns a new instance of Scope.
182 183 184 185 186 187 188 |
# File 'lib/spectroscope/example.rb', line 182 def initialize(group) @_group = group extend group.scope #include group.scope #extend self @_let ||= {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(s, *a, &b) ⇒ Object (private)
Handle implicit subject.
215 216 217 |
# File 'lib/spectroscope/example.rb', line 215 def method_missing(s, *a, &b) subject.__send__(s, *a, &b) # public_send end |
Instance Method Details
#pending(message = nil) ⇒ Object
193 194 195 |
# File 'lib/spectroscope/example.rb', line 193 def pending(=nil) raise NotImplementedError.new() end |
#subject ⇒ Object
200 201 202 203 204 205 206 207 208 |
# File 'lib/spectroscope/example.rb', line 200 def subject @_subject ||= ( if defined?(super) super || described_class.new else described_class.new end ) end |