Class: Aygabtu::ScopeActor
- Inherits:
-
Object
- Object
- Aygabtu::ScopeActor
- Defined in:
- lib/aygabtu/scope_actor.rb
Class Method Summary collapse
Instance Method Summary collapse
- #covered! ⇒ Object
- #ignore(reason) ⇒ Object
-
#initialize(scope, example_group) ⇒ ScopeActor
constructor
A new instance of ScopeActor.
- #pend(reason) ⇒ Object
- #visit ⇒ Object
- #visit_with(visiting_data) ⇒ Object
Constructor Details
#initialize(scope, example_group) ⇒ ScopeActor
Returns a new instance of ScopeActor.
7 8 9 |
# File 'lib/aygabtu/scope_actor.rb', line 7 def initialize(scope, example_group) @scope, @example_group = scope, example_group end |
Class Method Details
.actions ⇒ Object
11 12 13 |
# File 'lib/aygabtu/scope_actor.rb', line 11 def self.actions [:visit_with, :visit, :pend, :ignore, :covered!] end |
Instance Method Details
#covered! ⇒ Object
44 45 46 |
# File 'lib/aygabtu/scope_actor.rb', line 44 def covered! ignore "this is already covered by a non-aygabtu feature" end |
#ignore(reason) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/aygabtu/scope_actor.rb', line 32 def ignore(reason) raise "Reason for ignoring must be a string" unless reason.is_a?(String) each_empty_scope_segment do |scope, generator| generator.generate_no_match_failing_example(:ignore) end each_scope_segment_and_route do |scope, generator, route| mark_route(route, :ignore) end end |
#pend(reason) ⇒ Object
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/aygabtu/scope_actor.rb', line 48 def pend(reason) each_empty_scope_segment do |scope, generator| generator.generate_no_match_failing_example(:pend) end each_scope_segment_and_route do |scope, generator, route| mark_route(route, :pend) generator.generate_pending_example(route, reason) end end |
#visit ⇒ Object
28 29 30 |
# File 'lib/aygabtu/scope_actor.rb', line 28 def visit visit_with({}) end |
#visit_with(visiting_data) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/aygabtu/scope_actor.rb', line 15 def visit_with(visiting_data) each_empty_scope_segment do |scope, generator| generator.generate_no_match_failing_example(:visit) end each_scope_segment_and_route do |scope, generator, route| visiting_data = @scope.visiting_data.merge(visiting_data) mark_route(route, :visit) generator.generate_example(route, visiting_data) end end |