<commit_before>path = require 'path'
{$, $$, fs, RootView} = require 'atom'

ThemeManager = require '../src/theme-manager'
AtomPackage = require '../src/atom-package'

describe "ThemeManager", ->
  themeManager = null

  beforeEach ->
    themeManager = new ThemeManager
      packageManager: atom.packages
      resourcePath: window.resourcePath

  afterEach ->
    themeManager.deactivateThemes()

  describe "theme getters and setters", ->
    beforeEach ->
      atom.packages.loadPackages(sync: true)

    it 'getLoadedThemes get all the loaded themes', ->
      themes = themeManager.getLoadedThemes()
      expect(themes.length).toBeGreaterThan(2)

    it 'getActiveThemes get all the active themes', ->
      themeManager.activateThemes()
      names = atom.config.get('core.themes')
      expect(names.length).toBeGreaterThan(0)
      themes = themeManager.getActiveThemes()
      expect(themes).toHaveLength(names.length)<commit_msg>Use resource path from load settings<commit_after>path = require 'path'
{$, $$, fs, RootView} = require 'atom'

ThemeManager = require '../src/theme-manager'
AtomPackage = require '../src/atom-package'

describe "ThemeManager", ->
  themeManager = null
  resourcePath = atom.getLoadSettings().resourcePath

  beforeEach ->
    themeManager = new ThemeManager({packageManager: atom.packages, resourcePath})

  afterEach ->
    themeManager.deactivateThemes()

  describe "theme getters and setters", ->
    beforeEach ->
      atom.packages.loadPackages(sync: true)

    it 'getLoadedThemes get all the loaded themes', ->
      themes = themeManager.getLoadedThemes()
      expect(themes.length).toBeGreaterThan(2)

    it 'getActiveThemes get all the active themes', ->
      themeManager.activateThemes()
      names = atom.config.get('core.themes')
      expect(names.length).toBeGreaterThan(0)
      themes = themeManager.getActiveThemes()
      expect(themes).toHaveLength(names.length)
{'fraction_non_alphanumeric': 0.11795137092602173, 'fraction_numerical': 0.0020693222969477496, 'mean_word_length': 3.7401960784313726, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1053966', 'n_tokens_mistral': 563, 'n_tokens_neox': 543, 'n_words': 122}