<commit_before>require 'spec_helper'

describe Recap::Support::CapistranoExtensions do
  let :config do
    Capistrano::Configuration.new
  end

  describe "#edit_file" do
    before do
      Tempfile.any_instance.stubs(:path).returns('path/to/tempfile')
      config.stubs(:as_app)
      config.stubs(:system)
      config.stubs(:get)
    end

    it 'downloads the file to a temporary file for editing' do
      config.expects(:get).with('remote/path/to/file', 'path/to/tempfile')
      File.stubs(:read).with('path/to/tempfile')
      config.edit_file('remote/path/to/file')
    end
<commit_msg>Fix an inadvertantly-locally-passing build.<commit_after>require 'spec_helper'

describe Recap::Support::CapistranoExtensions do
  let :config do
    Capistrano::Configuration.new
  end

  describe "#edit_file" do
    before do
      Tempfile.any_instance.stubs(:path).returns('path/to/tempfile')
      config.stubs(:as_app)
      config.stubs(:system)
      config.stubs(:get)
      config.stubs(:editor).returns("some-editor")
    end

    it 'downloads the file to a temporary file for editing' do
      config.expects(:get).with('remote/path/to/file', 'path/to/tempfile')
      File.stubs(:read).with('path/to/tempfile')
      config.edit_file('remote/path/to/file')
    end

{'fraction_non_alphanumeric': 0.13234142521534847, 'fraction_numerical': 0.0, 'mean_word_length': 3.5806451612903225, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6333098', 'n_tokens_mistral': 422, 'n_tokens_neox': 413, 'n_words': 76}