class Roby::Test::ExecutionExpectations::Maintain

Public Class Methods

new(at_least_during, block, description, backtrace) click to toggle source
# File lib/roby/test/execution_expectations.rb, line 1043
def initialize(at_least_during, block, description, backtrace)
    super(backtrace)
    @at_least_during = at_least_during
    @description = description
    @block = block
    @deadline = Time.now + at_least_during
    @failed = false
end

Public Instance Methods

explain_unachievable(propagation_info) click to toggle source
# File lib/roby/test/execution_expectations.rb, line 1065
def explain_unachievable(propagation_info)
    "#{self} returned false"
end
to_s() click to toggle source
# File lib/roby/test/execution_expectations.rb, line 1069
def to_s
    if @description
        @description
    else
        @backtrace[0].to_s
    end
end
unachievable?(propagation_info) click to toggle source
# File lib/roby/test/execution_expectations.rb, line 1061
def unachievable?(propagation_info)
    @failed
end
update_match(propagation_info) click to toggle source
# File lib/roby/test/execution_expectations.rb, line 1052
def update_match(propagation_info)
    if !@block.call(propagation_info)
        @failed = true
        return false
    elsif Time.now > @deadline
        return true
    end
end