Add a nested suite
514838
function(description, body) {
          var suite = new JSpec.Suite(description, body)
          JSpec.allSuites.push(suite)
          suite.name = suite.description
          suite.description = this.description + ' ' + suite.description
          this.suites.push(suite)
          suite.suite = this
        }
239696
def register_suite():
    
    global test_suite
    frm = inspect.stack()[1]
    test_suite = ".".join(os.path.basename(frm[1]).split('.')[0:-1])
442116
def _nest(self):
        """"""
        self._flatten()
        parent_roles = {}
        for roleid in self.flatten:
            role = copy.deepcopy(self.flatten[roleid])

            # Display name is mandatory
            if 'display_name' not in role:
                raise MissingKey('display_name', role, self.role_file)

            if 'description' not in role:
                raise MissingKey('description', role, self.role_file)

            # Backend is mandatory
            if 'backends_groups' not in role:
                raise MissingKey('backends_groups', role, self.role_file)

            # Create the list of backends
            for backend in role['backends_groups']:
                self.backends.add(backend)

            if roleid not in self.graph:
                self.graph[roleid] = {
                    'parent_roles': set([]),
                    'sub_roles': set([])
                    }

        # Create the nested groups
        for roleid in self.flatten:
            role = copy.deepcopy(self.flatten[roleid])
            # create reverse groups 2 roles
            for b in role['backends_groups']:
                for g in role['backends_groups'][b]:
                    if b not in self.group2roles:
                        self.group2roles[b] = {}
                    if g not in self.group2roles[b]:
                        self.group2roles[b][g] = set([])
                    self.group2roles[b][g].add(roleid)

            parent_roles[roleid] = []
            for roleid2 in self.flatten:
                role2 = copy.deepcopy(self.flatten[roleid2])
                if self._is_parent(roleid, roleid2):
                    parent_roles[roleid].append(roleid2)
                    self.graph[roleid2]['parent_roles'].add(roleid)
                    self.graph[roleid]['sub_roles'].add(roleid2)

        for r in parent_roles:
            for p in parent_roles[r]:
                for p2 in parent_roles[r]:
                    if p != p2 and p in parent_roles[p2]:
                        parent_roles[r].remove(p)

        def nest(p):
            ret = copy.deepcopy(self.flatten[p])
            ret['subroles'] = {}
            if len(parent_roles[p]) == 0:
                return ret
            else:
                for i in parent_roles[p]:
                    sub = nest(i)
                    ret['subroles'][i] = sub
                return ret

        for p in parent_roles.keys():
            if p in parent_roles:
                self.roles[p] = nest(p)

        for roleid in self.roles:
            role = self.roles[roleid]
            # Create the list of roles which are ldapcherry admins
            if 'LC_admins' in role and role['LC_admins']:
                self.admin_roles.append(roleid)
                self._set_admin(role)
171752
public function addSuite($suite)
    {
        if (true === $this->pending) {
            $suite->setPending();
        }
        $this->suites[] = $suite;
    }
670612
public function addSuite($description, callable $fn, $pending = null, $focused = false)
    {
        $suite = $this->createSuite($description, $fn, $pending, $focused);

        $this->getCurrentSuite()->addTest($suite);
        array_unshift($this->suites, $suite);
        $suite->define();
        array_shift($this->suites);

        return $suite;
    }
1347742
private function getSuitePaths(Suite $suite)
    {
        if (!is_array($suite->getSetting('paths'))) {
            throw new SuiteConfigurationException(
                sprintf('`paths` setting of the "%s" suite is expected to be an array, %s given.',
                    $suite->getName(),
                    gettype($suite->getSetting('paths'))
                ),
                $suite->getName()
            );
        }

        return $suite->getSetting('paths');
    }
339700
def add (self, ps):
        
        assert isinstance(ps, PropertySet)
        if ps not in self.added_:
            self.added_[ps] = create(self.all_ + ps.all())
        return self.added_[ps]
1170427
def add_tracks(self, track):
        
        from trackhub import BaseTrack
        if isinstance(track, BaseTrack):
            self.add_child(track)
            self._tracks.append(track)
        else:
            for t in track:
                self.add_child(t)
                self._tracks.append(t)
529958
function AddrResult(hrp, version, hash) {
  this.hrp = hrp;
  this.version = version;
  this.hash = hash;
}
922436
function Suite(title) {
  this.title = _.title(title);
  this.parent = null;
  this.runnables = [];
  this.events = {
    pre: 'pre:suite',
    post: 'post:suite'
  };
}
383730
def _run_suite suite, type
      # suites are cases in minitest
      @turn_case = @turn_suite.new_case(suite.name)

      filter = normalize_filter(@options[:filter]) || @turn_config.pattern || /./

      suite.send("#{type}_methods").grep(/#{filter}/).each do |test|
        @turn_case.new_test(test)
      end

      turn_reporter.start_case(@turn_case)

      header = "#{type}_suite_header"
      puts send(header, suite) if respond_to? header

      assertions = @turn_case.tests.map do |test|
        @turn_test = test
        turn_reporter.start_test(@turn_test)

        inst = suite.new(test.name) #method
        inst._assertions = 0

        result = inst.run self

        if result == "."
          turn_reporter.pass
        end

        turn_reporter.finish_test(@turn_test)

        inst._assertions
      end

      @turn_case.count_assertions = assertions.inject(0) { |sum, n| sum + n }

      turn_reporter.finish_case(@turn_case)

      return assertions.size, assertions.inject(0) { |sum, n| sum + n }
    end
248506
function _suite(description, cb) {
            var test = new this(description, {});
            var it = test._addAction;
            _(["suite", "test", "timeout", "getAction", "beforeAll", "beforeEach",
                "afterAll", "afterEach", "context", "get", "set", "skip"]).forEach(function (key) {
                    it[key] = test[key];
                });
            cb(test);
            return test;
        }
1193641
def run_suite(self):
        '''
        
        '''
        if not self.phantomjs_runner:
            raise JsTestException('phantomjs_runner need to be defined')

        url = self.get_url()

        self.phantomjs(self.phantomjs_runner, url, title=self.title)
        self.cleanup()
637578
def expand_nested(self, cats):
        """"""
        down = '│'
        right = '└──'

        def get_children(parent):
            return [e() for e in parent._entries.values() if e._container == 'catalog']

        if len(cats) == 0:
            return

        cat = cats[0]
        old = list(self.options.items())
        name = next(k for k, v in old if v == cat)
        index = next(i for i, (k, v) in enumerate(old) if v == cat)
        if right in name:
            prefix = f'{name.split(right)[0]}{down} {right}'
        else:
            prefix = right

        children = get_children(cat)
        for i, child in enumerate(children):
            old.insert(index+i+1, (f'{prefix} {child.name}', child))
        self.widget.options = dict(old)
123670
def add(config = {})
      config.each do |key, value|
        define_setting key.to_sym, value
      end
    end
413281
def build_suite(args):
    """"""
    loader = Loader()
    if len(args.files) == 0 or args.files[0] == "-":
        suite = loader.load_suite_from_stdin()
    else:
        suite = loader.load(args.files)
    return suite
623925
def suite_name
      files.map{ |path| File.dirname(path).sub(Dir.pwd+'/','') }.uniq.join(',')
    end