Class: Roby::Test::ExecutionExpectations::Maintain
- Inherits:
-
Expectation
- Object
- Expectation
- Roby::Test::ExecutionExpectations::Maintain
- Defined in:
- lib/roby/test/execution_expectations.rb
Instance Attribute Summary
Attributes inherited from Expectation
Instance Method Summary collapse
- #explain_unachievable(propagation_info) ⇒ Object
-
#initialize(at_least_during, block, description, backtrace) ⇒ Maintain
constructor
A new instance of Maintain.
- #to_s ⇒ Object
- #unachievable?(propagation_info) ⇒ Boolean
- #update_match(propagation_info) ⇒ Object
Methods inherited from Expectation
Constructor Details
#initialize(at_least_during, block, description, backtrace) ⇒ Maintain
Returns a new instance of Maintain.
1043 1044 1045 1046 1047 1048 1049 1050 |
# 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 |
Instance Method Details
#explain_unachievable(propagation_info) ⇒ Object
1065 1066 1067 |
# File 'lib/roby/test/execution_expectations.rb', line 1065 def explain_unachievable(propagation_info) "#{self} returned false" end |
#to_s ⇒ Object
1069 1070 1071 1072 1073 1074 1075 |
# 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) ⇒ Boolean
1061 1062 1063 |
# File 'lib/roby/test/execution_expectations.rb', line 1061 def unachievable?(propagation_info) @failed end |
#update_match(propagation_info) ⇒ Object
1052 1053 1054 1055 1056 1057 1058 1059 |
# 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 |