Sha256: ecd8a9b9837516b9e7e522e40e23c817a5a96ac0ade874a8ac6de375fbdb76af

Contents?: true

Size: 558 Bytes

Versions: 1

Compression:

Stored size: 558 Bytes

Contents

module Unified

  class TestGroup
    def initialize(path, **opts)
      if String === path
        data = YAML.load(File.read(path))
      else
        data = path
      end
      @spec = BSON::ExtJSON.parse_obj(data)
      @options = opts
    end

    attr_reader :options

    def tests
      reqs = @spec['runOnRequirements']

      @spec.fetch('tests').map do |test|
        sub = @spec.dup
        sub.delete('tests')
        sub['test'] = test
        sub['group_runOnRequirements'] = reqs
        Test.new(sub, **options)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mongo-2.15.0.alpha spec/runners/unified/test_group.rb