Class: Roby::Test::ExecutionExpectations::NotEmitGenerator

Inherits:
Expectation show all
Defined in:
lib/roby/test/execution_expectations.rb

Instance Attribute Summary

Attributes inherited from Expectation

#backtrace

Instance Method Summary collapse

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
    @related_error_matcher = 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

Returns:

  • (Boolean)


723
724
725
# File 'lib/roby/test/execution_expectations.rb', line 723

def relates_to_error?(error)
    @related_error_matcher === error
end

#to_sObject



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

Returns:

  • (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