Sha256: 1a79c0b2c6855beae10a919bf0afb81bebff0bb83a183541ad52cbbb848338fd

Contents?: true

Size: 1.13 KB

Versions: 3

Compression:

Stored size: 1.13 KB

Contents

module OrigenTesters
  module SmartestBasedTester
    class Base
      class TestMethods
        class Limits
          attr_reader :test_method
          attr_accessor :lo_limit, :hi_limit

          def initialize(test_method)
            @test_method = test_method
          end

          def to_s
            if !lo_limit && !hi_limit
              "\"#{test_name}\"" + ' = "":"NA":"":"NA":"":"":""'
            elsif !lo_limit
              "\"#{test_name}\"" + " = \"\":\"NA\":\"#{hi_limit}\":\"LE\":\"\":\"\":\"0\""
            elsif !hi_limit
              "\"#{test_name}\"" + " = \"#{lo_limit}\":\"GE\":\"\":\"NA\":\"\":\"\":\"0\""
            else
              "\"#{test_name}\"" + " = \"#{lo_limit}\":\"GE\":\"#{hi_limit}\":\"LE\":\"\":\"\":\"0\""
            end
          end

          def set_lo_limit(val)
            self.lo_limit = val
          end

          def set_hi_limit(val)
            self.hi_limit = val
          end

          private

          def test_name
            name = test_method.test_name if test_method.respond_to?(:test_name)
            name || 'Functional'
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
origen_testers-0.5.0 lib/origen_testers/smartest_based_tester/base/test_methods/limits.rb
origen_testers-0.4.1 lib/origen_testers/smartest_based_tester/base/test_methods/limits.rb
origen_testers-0.4.0 lib/origen_testers/smartest_based_tester/base/test_methods/limits.rb