Sha256: be16d93c805eb1e197b207625e48a97a808e582187aca4778f7a5dd7867684d9

Contents?: true

Size: 764 Bytes

Versions: 7

Compression:

Stored size: 764 Bytes

Contents

require 'diff/lcs'
require_relative '../lib/learn_open'
require_relative 'fakes/fake_git.rb'
require_relative 'fakes/fake_learn_client.rb'

ENV["GEM_ENV"] = "test"

def home_dir
  Dir.home
end

def create_home_dir
  FileUtils.mkdir_p home_dir
end

def create_linux_home_dir(username)
  home_dir = "/home/#{username}"
  FileUtils.mkdir_p home_dir
  home_dir
end

def create_netrc_file
  File.open("#{home_dir}/.netrc", "w+") do |f|
    f.write(<<-EOF)
machine learn-config
login learn
password some-amazing-password
    EOF
  end
  File.chmod(0600, "#{home_dir}/.netrc")
end

def create_learn_config_file
  File.open("#{home_dir}/.learn-config", "w+") do |f|
    f.write(<<-EOF)
---
:learn_directory: "/home/bobby/Development/code"
:editor: atom
    EOF
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
learn-open-1.2.28 spec/spec_helper.rb
learn-open-1.2.27 spec/spec_helper.rb
learn-open-1.2.26 spec/spec_helper.rb
learn-open-1.2.24 spec/spec_helper.rb
learn-open-1.2.23 spec/spec_helper.rb
learn-open-1.2.22 spec/spec_helper.rb
learn-open-1.2.21 spec/spec_helper.rb