Class: Roby::Test::ExecutionExpectations::NotEmitGenerator
- Inherits:
-
Expectation
- Object
- Expectation
- Roby::Test::ExecutionExpectations::NotEmitGenerator
- Defined in:
- lib/roby/test/execution_expectations.rb
Instance Attribute Summary
Attributes inherited from Expectation
Instance Method Summary collapse
- #explain_unachievable(propagation_info) ⇒ Object
-
#initialize(generator, backtrace) ⇒ NotEmitGenerator
constructor
A new instance of NotEmitGenerator.
- #relates_to_error?(error) ⇒ Boolean
- #to_s ⇒ Object
- #unachievable?(propagation_info) ⇒ Boolean
- #update_match(propagation_info) ⇒ Object
Constructor Details
#initialize(generator, backtrace) ⇒ NotEmitGenerator
Returns a new instance of NotEmitGenerator.
697 698 699 700 701 702 703 |
# File 'lib/roby/test/execution_expectations.rb', line 697 def initialize(generator, backtrace) super(backtrace) @generator = generator = Queries::LocalizedErrorMatcher.new. with_origin(@generator). to_execution_exception_matcher end |
Instance Method Details
#explain_unachievable(propagation_info) ⇒ Object
719 720 721 |
# File 'lib/roby/test/execution_expectations.rb', line 719 def explain_unachievable(propagation_info) @emitted_events.first end |
#relates_to_error?(error) ⇒ Boolean
723 724 725 |
# File 'lib/roby/test/execution_expectations.rb', line 723 def relates_to_error?(error) === error end |
#to_s ⇒ Object
705 706 707 |
# File 'lib/roby/test/execution_expectations.rb', line 705 def to_s "#{@generator} should not be emitted" end |
#unachievable?(propagation_info) ⇒ Boolean
715 716 717 |
# File 'lib/roby/test/execution_expectations.rb', line 715 def unachievable?(propagation_info) !@emitted_events.empty? end |
#update_match(propagation_info) ⇒ Object
709 710 711 712 713 |
# File 'lib/roby/test/execution_expectations.rb', line 709 def update_match(propagation_info) @emitted_events = propagation_info.emitted_events. find_all { |ev| ev.generator == @generator } @emitted_events.empty? end |