<commit_before>expect      = require('chai').expect
Browser     = require '../../../src/lib/browser'

describe "Browser", ->
  browser = null
  beforeEach ->
    browser = new Browser

  it "should return null if a url is not provided", ->
    cmd = browser.buildCommand()
    expect(cmd).to.eql null

  it "should create a command with no flags", ->
    cmd = browser.buildCommand("www.netflix.com")
    expect(cmd).to.eql "google-chrome  www.netflix.com"

  it "should create a command with a user and url", ->
    cmd = browser.buildCommand("www.netflix.com", "--profile-directory": "\"Profile 1\"")
    expect(cmd).to.eql "google-chrome --profile-directory=\"Profile 1\" www.netflix.com"<commit_msg>Updates tests for Netflix controller<commit_after>expect      = require('chai').expect
Browser     = require '../../../src/lib/browser'

describe "Browser", ->
  browser = null
  beforeEach ->
    browser = new Browser

  it "should return null if a url is not provided", ->
    cmd = browser.buildCommand()
    expect(cmd).to.eql null

  it 'should quote the url argument', ->
    cmd = browser.buildCommand('this is a search term for Chrome')
    expect(cmd).to.eql 'google-chrome  "this is a search term for Chrome"'

  it 'should NOT double quote the url argument', ->
    cmd = browser.buildCommand('"already quoted"')
    expect(cmd).to.eql 'google-chrome  "already quoted"'

  it "should create a command with no flags", ->
    cmd = browser.buildCommand("www.netflix.com")
    expect(cmd).to.eql 'google-chrome  "www.netflix.com"'

  it "should create a command with a user and url", ->
    cmd = browser.buildCommand("www.netflix.com", "--profile-directory": "\"Profile 1\"")
    expect(cmd).to.eql 'google-chrome --profile-directory="Profile 1" "www.netflix.com"'
{'fraction_non_alphanumeric': 0.14864864864864866, 'fraction_numerical': 0.0022522522522522522, 'mean_word_length': 3.261390887290168, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, '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': '6418419', 'n_tokens_mistral': 548, 'n_tokens_neox': 527, 'n_words': 161}