Class: Roby::Test::ExecutionExpectations::HaveFrameworkError

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

Instance Attribute Summary

Attributes inherited from Expectation

#backtrace

Instance Method Summary collapse

Methods inherited from Expectation

#explain_unachievable, #filter_result, #filter_result_with, #format_unachievable_explanation, #unachievable?

Constructor Details

#initialize(error_matcher, backtrace) ⇒ HaveFrameworkError

Returns a new instance of HaveFrameworkError.



1252
1253
1254
1255
# File 'lib/roby/test/execution_expectations.rb', line 1252

def initialize(error_matcher, backtrace)
    super(backtrace)
    @error_matcher = error_matcher
end

Instance Method Details

#relates_to_error?(error) ⇒ Boolean

Returns:

  • (Boolean)


1265
1266
1267
# File 'lib/roby/test/execution_expectations.rb', line 1265

def relates_to_error?(error)
    @matched_exceptions.include?(error)
end

#to_sObject



1269
1270
1271
# File 'lib/roby/test/execution_expectations.rb', line 1269

def to_s
    "should have a framework error matching #{@error_matcher}"
end

#update_match(propagation_info) ⇒ Object



1257
1258
1259
1260
1261
1262
1263
# File 'lib/roby/test/execution_expectations.rb', line 1257

def update_match(propagation_info)
    @matched_exceptions =
        propagation_info
        .framework_errors.map(&:first)
        .find_all { |e| @error_matcher === e }
    !@matched_exceptions.empty?
end