<commit_before>goog.provide 'acorn.specs.player.PlayerView'

goog.require 'acorn.player.PlayerView'

describe 'acorn.player.PlayerView', ->
  PlayerView = acorn.player.PlayerView
  EventSpy = athena.lib.util.test.EventSpy
  derives = athena.lib.util.derives
  Shell = acorn.shells.Shell

  # model for PlayerView contruction
  model = acorn.Model.withData
    acornid: 'thebestacornever'
    thumbnail: acorn.config.img.acorn
    title: 'The Best Title Ever'
    type: 'image'
    shell:
      shellid: 'acorn.Shell'

  # options for ContentView contruction
  options = model: model


  it 'should be part of acorn.player', ->
    expect(PlayerView).toBeDefined()

  describe 'model verification', ->

    it 'should fail to construct if model was not passed in', ->
      expect(-> new PlayerView).toThrow()

    it 'should fail to construct if model does not define shellModel', ->
      m = model.clone()
      m.set shell: undefined
      expect(-> new PlayerView model: m).toThrow()

    it 'should fail to construct if model type is incorrect', ->
      expect(-> new PlayerView model: new athena.lib.Model).toThrow()
      expect(-> new PlayerView model: new acorn.shells.Shell.Model).toThrow()
<commit_msg>test: bugfix: playerView test suite errored out<commit_after>goog.provide 'acorn.specs.player.PlayerView'

goog.require 'acorn.player.PlayerView'

describe 'acorn.player.PlayerView', ->
  PlayerView = acorn.player.PlayerView
  EventSpy = athena.lib.util.test.EventSpy
  derives = athena.lib.util.derives
  Shell = acorn.shells.Shell

  # model for PlayerView contruction
  model = acorn.Model.withData
    acornid: 'agoodacorn'
    thumbnail: acorn.config.img.acorn
    title: 'The Best Title Ever'
    type: 'image'
    shell:
      shellid: 'acorn.Shell'

  # options for ContentView contruction
  options = model: model


  it 'should be part of acorn.player', ->
    expect(PlayerView).toBeDefined()

  describe 'model verification', ->

    it 'should fail to construct if model was not passed in', ->
      expect(-> new PlayerView).toThrow()

    it 'should fail to construct if model does not define shellModel', ->
      m = model.clone()
      m.set shell: undefined
      expect(-> new PlayerView model: m).toThrow()

    it 'should fail to construct if model type is incorrect', ->
      expect(-> new PlayerView model: new athena.lib.Model).toThrow()
      expect(-> new PlayerView model: new acorn.shells.Shell.Model).toThrow()

{'fraction_non_alphanumeric': 0.10993485342019543, 'fraction_numerical': 0.0, 'mean_word_length': 3.3333333333333335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, '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': '4029679', 'n_tokens_mistral': 782, 'n_tokens_neox': 756, 'n_words': 222}