Class: Roby::Test::ExecutionExpectations::EmitGenerator
- Inherits:
-
Expectation
- Object
- Expectation
- Roby::Test::ExecutionExpectations::EmitGenerator
- Defined in:
- lib/roby/test/execution_expectations.rb
Instance Attribute Summary collapse
-
#generator ⇒ Object
readonly
Returns the value of attribute generator.
Attributes inherited from Expectation
Instance Method Summary collapse
- #explain_unachievable(propagation_info) ⇒ Object
-
#initialize(generator, backtrace) ⇒ EmitGenerator
constructor
A new instance of EmitGenerator.
- #relates_to_error?(error) ⇒ Boolean
- #return_object ⇒ Object
- #to_s ⇒ Object
- #unachievable?(propagation_info) ⇒ Boolean
- #update_match(propagation_info) ⇒ Object
Constructor Details
#initialize(generator, backtrace) ⇒ EmitGenerator
Returns a new instance of EmitGenerator.
809 810 811 812 813 814 815 |
# File 'lib/roby/test/execution_expectations.rb', line 809 def initialize(generator, backtrace) super(backtrace) @generator = generator = Queries::LocalizedErrorMatcher.new. with_origin(@generator). to_execution_exception_matcher end |
Instance Attribute Details
#generator ⇒ Object (readonly)
Returns the value of attribute generator.
807 808 809 |
# File 'lib/roby/test/execution_expectations.rb', line 807 def generator @generator end |
Instance Method Details
#explain_unachievable(propagation_info) ⇒ Object
835 836 837 |
# File 'lib/roby/test/execution_expectations.rb', line 835 def explain_unachievable(propagation_info) @generator.unreachability_reason end |
#relates_to_error?(error) ⇒ Boolean
839 840 841 |
# File 'lib/roby/test/execution_expectations.rb', line 839 def relates_to_error?(error) === error end |
#return_object ⇒ Object
827 828 829 |
# File 'lib/roby/test/execution_expectations.rb', line 827 def return_object @emitted_events.first end |
#to_s ⇒ Object
817 818 819 |
# File 'lib/roby/test/execution_expectations.rb', line 817 def to_s "#{@generator} should be emitted" end |
#unachievable?(propagation_info) ⇒ Boolean
831 832 833 |
# File 'lib/roby/test/execution_expectations.rb', line 831 def unachievable?(propagation_info) @generator.unreachable? end |
#update_match(propagation_info) ⇒ Object
821 822 823 824 825 |
# File 'lib/roby/test/execution_expectations.rb', line 821 def update_match(propagation_info) @emitted_events = propagation_info.emitted_events. find_all { |ev| ev.generator == @generator } !@emitted_events.empty? end |