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, #unachievable?

Constructor Details

#initialize(error_matcher, backtrace) ⇒ HaveFrameworkError

Returns a new instance of HaveFrameworkError.



1022
1023
1024
1025
# File 'lib/roby/test/execution_expectations.rb', line 1022

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

Instance Method Details

#relates_to_error?(error) ⇒ Boolean

Returns:

  • (Boolean)


1033
1034
1035
# File 'lib/roby/test/execution_expectations.rb', line 1033

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

#to_sObject



1037
1038
1039
# File 'lib/roby/test/execution_expectations.rb', line 1037

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

#update_match(propagation_info) ⇒ Object



1027
1028
1029
1030
1031
# File 'lib/roby/test/execution_expectations.rb', line 1027

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