Class Uttk::Strategies::Threshold
In: lib/uttk/strategies/Threshold.rb
Parent: Proxy

I validate the status of the strategy test if it is under the value of my threshold attribute.

Methods

Included Modules

Concrete

Protected Instance methods

[Source]

# File lib/uttk/strategies/Threshold.rb, line 28
      def assertion
        compute_final_weight
        final = @final_weight.get
        @log.final_weight = final
        fail("Not enough (#{final} < #@threshold)") if @final_weight < @threshold
        pass
      end

[Source]

# File lib/uttk/strategies/Threshold.rb, line 16
      def prologue
        super
        if @threshold > 1
          raise ArgumentError, "Threshold too high: #@threshold not in [0..1]"
        elsif @threshold < 0
          raise ArgumentError, "Threshold too low: #@threshold not in [0..1]"
        end
        create(@test)
      end

[Validate]