<commit_before>source plugin/redub.vim

function CloseAllBuffers()
  for l:n in range(1, bufnr("$"))
    if bufexists(l:n)
      exec 'bdelete! ' . l:n
    endif
  endfor
endfunction

function CleanOutTmp()
  if !isdirectory("tmp")
    call mkdir("tmp")
  endif

  for l:file_name in glob("tmp/*", 1, 1)
    call delete(l:file_name)
  end
endfunction

function InsertText(text)
  exec 'normal i' . a:text
endfunction

describe 'Redub'
  before
    call CloseAllBuffers()
    call CleanOutTmp()
  end

  it 'renames the current buffer'
    call InsertText('Hello, world!')
    write tmp/foo.txt

    Redub tmp/bar.txt

    Expect bufname("%") == "tmp/bar.txt"<commit_msg>Poking around to get tests working on Travis.<commit_after>source plugin/redub.vim

function CloseAllBuffers()
  for l:n in range(1, bufnr("$"))
    if bufexists(l:n)
      exec 'bdelete! ' . l:n
    endif
  endfor
endfunction

function CleanOutTmp()
  if !isdirectory("tmp")
    call mkdir("tmp")
  endif

  !rm tmp/*

  " for l:file_name in glob("tmp/*", 1, 1)
  "   call delete(l:file_name)
  " end
endfunction

function InsertText(text)
  exec 'normal i' . a:text
endfunction

describe 'Redub'
  before
    call CloseAllBuffers()
    call CleanOutTmp()
  end

  it 'renames the current buffer'
    call InsertText('Hello, world!')
    write tmp/foo.txt

    Redub tmp/bar.txt

    Expect bufname("%") == "tmp/bar.txt"
{'fraction_non_alphanumeric': 0.12293314162473042, 'fraction_numerical': 0.004313443565780014, 'mean_word_length': 3.3229813664596275, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1306765', 'n_tokens_mistral': 519, 'n_tokens_neox': 500, 'n_words': 136}