Class: Roby::Test::ExecutionExpectations::Achieve

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

Constructor Details

#initialize(block, description, backtrace) ⇒ Achieve

Returns a new instance of Achieve.



1311
1312
1313
1314
1315
# File 'lib/roby/test/execution_expectations.rb', line 1311

def initialize(block, description, backtrace)
    super(backtrace)
    @description = description || @backtrace[0].to_s
    @block = block
end

Instance Method Details

#return_objectObject



1321
1322
1323
# File 'lib/roby/test/execution_expectations.rb', line 1321

def return_object
    @achieved
end

#to_sObject



1325
1326
1327
1328
1329
1330
1331
# File 'lib/roby/test/execution_expectations.rb', line 1325

def to_s
    if @description.respond_to?(:call)
        @description.call
    else
        @description
    end
end

#update_match(propagation_info) ⇒ Object



1317
1318
1319
# File 'lib/roby/test/execution_expectations.rb', line 1317

def update_match(propagation_info)
    @achieved ||= @block.call(propagation_info)
end