Class: Roby::Test::ExecutionExpectations::NotEmitGenerator
Instance Attribute Summary
Attributes inherited from Expectation
#backtrace
Instance Method Summary
collapse
Methods inherited from Expectation
#filter_result, #filter_result_with
Constructor Details
#initialize(generator, backtrace, within: 0.5) ⇒ NotEmitGenerator
Returns a new instance of NotEmitGenerator.
919
920
921
922
923
924
925
926
927
928
929
930
|
# File 'lib/roby/test/execution_expectations.rb', line 919
def initialize(generator, backtrace, within: 0.5)
super(backtrace)
@generator = generator
@emitted_events = []
@related_error_matcher =
Queries::LocalizedErrorMatcher
.new
.with_origin(@generator)
.to_execution_exception_matcher
@deadline = Time.now_without_mock_time + within
end
|
Instance Method Details
#explain_unachievable(_propagation_info) ⇒ Object
949
950
951
|
# File 'lib/roby/test/execution_expectations.rb', line 949
def explain_unachievable(_propagation_info)
@emitted_events.first
end
|
957
958
959
960
|
# File 'lib/roby/test/execution_expectations.rb', line 957
def format_unachievable_explanation(pp, explanation)
pp.text "but it was: "
explanation.pretty_print(pp)
end
|
#relates_to_error?(error) ⇒ Boolean
953
954
955
|
# File 'lib/roby/test/execution_expectations.rb', line 953
def relates_to_error?(error)
@related_error_matcher === error
end
|
932
933
934
|
# File 'lib/roby/test/execution_expectations.rb', line 932
def to_s
"#{@generator} should not be emitted"
end
|
#unachievable?(_propagation_info) ⇒ Boolean
945
946
947
|
# File 'lib/roby/test/execution_expectations.rb', line 945
def unachievable?(_propagation_info)
!@emitted_events.empty?
end
|
#update_match(propagation_info) ⇒ Object
936
937
938
939
940
941
942
943
|
# File 'lib/roby/test/execution_expectations.rb', line 936
def update_match(propagation_info)
@emitted_events +=
propagation_info
.emitted_events
.find_all { |ev| ev.generator == @generator }
@emitted_events.empty? if Time.now_without_mock_time >= @deadline
end
|