Sha256: ccee59ae8b9520f655fd19c237a776cd10e6fb30695c0ebc3137464951f5c94a

Contents?: true

Size: 1.01 KB

Versions: 8

Compression:

Stored size: 1.01 KB

Contents

module OrigenTesters
  class Doc
    module Generator
      class Tests
        attr_accessor :collection

        def initialize
          @collection = []
        end

        class IndexedString < ::String
          attr_accessor :index

          def name
            self
          end
        end

        def add(name, attrs = {})
          test = Test.new(name, attrs)
          if @current_group
            @current_group << test
          else
            collection << test
          end
          test
        end

        # Arbitrarily group a subset of tests together, see the J750 API for details on how to use
        # this.
        def group(name = nil, options = {})
          name, options = nil, name if name.is_a?(Hash)
          @current_group = TestGroup.new(name, options)
          collection << @current_group
          yield @current_group
          @current_group = nil
        end
        alias_method :add_group, :group

        def render(_file, _options = {})
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
origen_testers-0.5.7 lib/origen_testers/doc/generator/tests.rb
origen_testers-0.5.6 lib/origen_testers/doc/generator/tests.rb
origen_testers-0.5.5 lib/origen_testers/doc/generator/tests.rb
origen_testers-0.5.4 lib/origen_testers/doc/generator/tests.rb
origen_testers-0.5.3 lib/origen_testers/doc/generator/tests.rb
origen_testers-0.5.2 lib/origen_testers/doc/generator/tests.rb
origen_testers-0.5.1 lib/origen_testers/doc/generator/tests.rb
origen_testers-0.5.0 lib/origen_testers/doc/generator/tests.rb