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.



1314
1315
1316
1317
# File 'lib/roby/test/execution_expectations.rb', line 1314

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

Instance Method Details

#relates_to_error?(error) ⇒ Boolean

Returns:

  • (Boolean)


1327
1328
1329
# File 'lib/roby/test/execution_expectations.rb', line 1327

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

#to_sObject



1331
1332
1333
# File 'lib/roby/test/execution_expectations.rb', line 1331

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

#update_match(propagation_info) ⇒ Object



1319
1320
1321
1322
1323
1324
1325
# File 'lib/roby/test/execution_expectations.rb', line 1319

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