Sha256: 68effb065aacd96a64edb7c0bc9fb6f3304be4b4c2046a3b6082598aca1e6992

Contents?: true

Size: 1.44 KB

Versions: 101

Compression:

Stored size: 1.44 KB

Contents

module OrigenTesters
  module IGXLBasedTester
    class Base
      class TestInstanceGroup
        attr_accessor :name, :version, :append_version

        include Enumerable

        def initialize(name, options = {})
          @name = name
          @store = []
          @append_version = true
        end

        def name
          if unversioned_name
            if version && @append_version
              "#{unversioned_name}_v#{version}"
            else
              unversioned_name.to_s
            end
          end
        end

        def unversioned_name
          if @name
            if @name =~ /grp$/
              @name
            else
              "#{@name}_grp"
            end
          end
        end

        def <<(instance)
          @store << instance
        end

        def size
          @store.size
        end

        def each
          @store.each { |ins| yield ins }
        end

        def ==(other_instance_group)
          self.class == other_instance_group.class &&
            unversioned_name.to_s == other_instance_group.unversioned_name.to_s &&
            size == other_instance_group.size &&
            self.all? do |ins|
              other_instance_group.any? { |other_ins| ins == other_ins }
            end
        end

        def finalize
          lambda do |group|
            each do |ti|
              ti.finalize.call(ti) if ti.finalize
            end
          end
        end
      end
    end
  end
end

Version data entries

101 entries across 101 versions & 1 rubygems

Version Path
origen_testers-0.9.5 lib/origen_testers/igxl_based_tester/base/test_instance_group.rb
origen_testers-0.9.4 lib/origen_testers/igxl_based_tester/base/test_instance_group.rb
origen_testers-0.9.3 lib/origen_testers/igxl_based_tester/base/test_instance_group.rb
origen_testers-0.9.2 lib/origen_testers/igxl_based_tester/base/test_instance_group.rb
origen_testers-0.9.1 lib/origen_testers/igxl_based_tester/base/test_instance_group.rb
origen_testers-0.9.0 lib/origen_testers/igxl_based_tester/base/test_instance_group.rb
origen_testers-0.8.13 lib/origen_testers/igxl_based_tester/base/test_instance_group.rb
origen_testers-0.8.11 lib/origen_testers/igxl_based_tester/base/test_instance_group.rb
origen_testers-0.8.8 lib/origen_testers/igxl_based_tester/base/test_instance_group.rb
origen_testers-0.8.7 lib/origen_testers/igxl_based_tester/base/test_instance_group.rb
origen_testers-0.8.6 lib/origen_testers/igxl_based_tester/base/test_instance_group.rb
origen_testers-0.8.5 lib/origen_testers/igxl_based_tester/base/test_instance_group.rb
origen_testers-0.8.4 lib/origen_testers/igxl_based_tester/base/test_instance_group.rb
origen_testers-0.8.3 lib/origen_testers/igxl_based_tester/base/test_instance_group.rb
origen_testers-0.8.2 lib/origen_testers/igxl_based_tester/base/test_instance_group.rb
origen_testers-0.8.1 lib/origen_testers/igxl_based_tester/base/test_instance_group.rb
origen_testers-0.8.0 lib/origen_testers/igxl_based_tester/base/test_instance_group.rb
origen_testers-0.8.0.pre1 lib/origen_testers/igxl_based_tester/base/test_instance_group.rb
origen_testers-0.7.13 lib/origen_testers/igxl_based_tester/base/test_instance_group.rb
origen_testers-0.7.12 lib/origen_testers/igxl_based_tester/base/test_instance_group.rb