Class: Syskit::Test::ExecutionExpectations::HaveNoNewSample

Inherits:
Roby::Test::ExecutionExpectations::Maintain
  • Object
show all
Defined in:
lib/syskit/test/execution_expectations.rb

Instance Method Summary collapse

Constructor Details

#initialize(reader, at_least_during, backtrace) ⇒ HaveNoNewSample

Returns a new instance of HaveNoNewSample



25
26
27
28
29
30
# File 'lib/syskit/test/execution_expectations.rb', line 25

def initialize(reader, at_least_during, backtrace)
    @reader = reader
    orocos_reader = ExecutionExpectations.resolve_orocos_reader(reader)
    block = proc { !(@received_sample = orocos_reader.read_new) }
    super(at_least_during, block, "", backtrace)
end

Instance Method Details

#explain_unachievable(propagation_info) ⇒ Object



36
37
38
# File 'lib/syskit/test/execution_expectations.rb', line 36

def explain_unachievable(propagation_info)
    @received_sample
end

#format_unachievable_explanation(pp, explanation) ⇒ Object



40
41
42
43
# File 'lib/syskit/test/execution_expectations.rb', line 40

def format_unachievable_explanation(pp, explanation)
    pp.text "but it received one: "
    explanation.pretty_print(pp)
end

#to_sObject



32
33
34
# File 'lib/syskit/test/execution_expectations.rb', line 32

def to_s
    "#{@reader} should not have received a new sample"
end