Sha256: cf606949bc5666d00362ade23181301cac8e7fb23df24a8484f276a3c627f144

Contents?: true

Size: 1.32 KB

Versions: 27

Compression:

Stored size: 1.32 KB

Contents

module OrigenTesters
  module SmartestBasedTester
    class Base
      class TestMethods
        # Base class of all test method libraries
        class BaseTml
          # Returns the test_methods object for the current flow
          attr_reader :test_methods

          def initialize(test_methods)
            @test_methods = test_methods
          end

          def method_missing(method, *args, &block)
            if definitions[method]
              instantiate_test_method(method, args)
            else
              method = method.to_s.underscore.to_sym
              if definitions[method]
                instantiate_test_method(method, args)
              else
                super
              end
            end
          end

          def platform
            Origen.interface.platform
          end

          def definitions
            @definitions || self.class::TEST_METHODS
          end

          private

          def instantiate_test_method(method, args)
            m = platform::TestMethod.new methods: definitions[method].dup,
                                         attrs:   (args.first || {}),
                                         type:    method,
                                         library: self
            test_methods.add(m)
            m
          end
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
origen_testers-0.52.8 lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb
origen_testers-0.52.7 lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb
origen_testers-0.52.6 lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb
origen_testers-0.52.5 lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb
origen_testers-0.52.4 lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb
origen_testers-0.52.3 lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb
origen_testers-0.52.1 lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb
origen_testers-0.52.0 lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb
origen_testers-0.51.5 lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb
origen_testers-0.51.4 lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb
origen_testers-0.51.3 lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb
origen_testers-0.51.2 lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb
origen_testers-0.51.1 lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb
origen_testers-0.51.0 lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb
origen_testers-0.50.0 lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb
origen_testers-0.49.4 lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb
origen_testers-0.49.3 lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb
origen_testers-0.49.2 lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb
origen_testers-0.49.1 lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb
origen_testers-0.49.0 lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb