46 Commits

Author SHA1 Message Date
Jeremy Cook
7080321081 Regenerate gemspec for version 1.1.6 2017-12-20 16:03:17 -05:00
Jeremy Cook
9d9cf66de6 Prepare for release of new version 2017-12-20 16:01:20 -05:00
Jeremy Cook
9e9a940825 Merge pull request #170 from diraol/fix-fileutils
Require fileutils correctly
2017-12-18 10:48:14 -05:00
Diego Rabatone Oliveira
257e974c38 Require fileutils correctly
Fix #165
2017-12-18 13:40:44 -02:00
Jeremy Cook
615e31428c Merge pull request #167 from mail6543210/master
Fix "diff" action on binary files
2017-10-13 17:59:36 -04:00
mail6543210
8c2a1d0f84 Add testcase 2017-09-23 00:41:33 +08:00
mail6543210
62c934774b Real fix for #148 2017-09-19 20:30:15 +08:00
mail6543210
d3d6974b7b Rename content to source
It is a instance of Pathname, not binary content
2017-09-19 20:29:06 +08:00
mail6543210
474d69da0b Revert "Use source content instead of source path (fixes: #148)"
This reverts commit ed397bdaf8.
2017-09-19 20:26:01 +08:00
Jeremy Cook
db6a513d1d Merge pull request #166 from MainShayne233/master
Enhancement/Add 'to' to error message.
2017-09-02 19:59:40 -04:00
Shayne Tremblay
ae343c4cab Add 'to' to error message. 2017-09-02 13:06:46 -07:00
Jeremy Cook
a2b365fb6f Merge pull request #164 from fuzzbomb/update-README-symlink-command
Rename symlink command to link in README.
2017-08-28 12:55:50 -04:00
Andrew Macpherson
4cb2006f41 Rename symlink command to link in README.
symlink command was previously renamed to link, but references in the README
were not updated.
2017-06-12 17:37:45 +01:00
Jeremy Cook
66347d307f Merge pull request #161 from philoserf/patch-1
Update ChangeLog.markdown
2017-03-23 17:33:31 -04:00
Mark Ayers
8f92a1b4f0 Update ChangeLog.markdown
Add the space that markdown requires between the header marker `#` and the header text.
2017-03-23 13:44:33 -07:00
Jeremy Cook
7a2df591c0 Regenerate gemspec for version 1.1.5 2017-03-23 08:37:44 -04:00
Jeremy Cook
4923265dea Updated homesick version and changelog due to problem with version
number in release.
2017-03-23 08:34:47 -04:00
Jeremy Cook
79421580e9 Merge branch 'master' of github.com:technicalpickles/homesick 2017-03-22 17:24:28 -04:00
Jeremy Cook
cabde9e5f1 Updated change log for new version. 2017-03-22 17:23:49 -04:00
Jeremy Cook
0d60ae9d1a Regenerate gemspec for version 1.1.4 2017-03-22 17:14:09 -04:00
Jeremy Cook
d5317b8e17 Bumped version in preparation for release. 2017-03-22 17:10:23 -04:00
Jeremy Cook
3b8a5b4be4 Merge pull request #159 from mruwek/refactor-conflict-actions
Wrap symlink and regular conflicts into one case
2017-03-20 16:07:19 -04:00
Jacek Sowiński
6590a1eeff Wrap symlink and regular conflicts into one case
This way we're not duplicating collision-related code.
2017-03-20 20:26:14 +01:00
Jeremy Cook
693ae5f05e Merge pull request #157 from mruwek/verbose-symlink-conflicts
Don't overwrite silently on symlink conflicts
2017-03-19 22:02:41 -04:00
Jeremy Cook
da3002f199 Merge pull request #154 from singular0/symlink_realpath
Use real paths of symlinks when linking castle into home
2017-03-19 22:02:01 -04:00
Jeremy Cook
feaaab2fa4 Merge pull request #158 from JCook21/master
Minor updates
2017-03-19 22:00:34 -04:00
Jeremy Cook
59f75711a4 Changed strings to use symbols. 2017-03-19 15:57:44 -04:00
Jeremy Cook
f24030b51f Updates to Gemfile to clean it up. 2017-03-19 15:57:22 -04:00
Jeremy Cook
71bb120a12 Update to dependency. 2017-03-19 14:44:44 -04:00
Jacek Sowiński
85f46e01b1 Don't overwrite silently on symlink conflicts
Symlink conflicts are now handled in similar fashion as normal
file-conflicts.
2017-03-17 19:31:23 +01:00
Jeremy Cook
c5b24b9b38 Merge pull request #155 from danielbayerlein/ruby-2.4.0
Add support for Ruby 2.4.0
2016-12-26 07:08:38 -05:00
Daniel Bayerlein
68460af45e Add support for Ruby 2.4.0 2016-12-26 10:31:34 +01:00
Denis Yantarev
5614b6b8b3 Use real paths of symlinks when linking castle into home 2016-12-25 18:34:33 +03:00
Jeremy Cook
570b063632 Merge pull request #152 from singular0/master
Thanks for taking care of this.
2016-12-24 12:13:55 -05:00
Jeremy Cook
1d398587d0 Remove config for removed ruby versions.
Deleted config for unused ruby versions.
2016-12-24 12:11:01 -05:00
Jeremy Cook
085853faaa Merge branch 'master' into master 2016-12-24 12:05:54 -05:00
Jeremy Cook
21b4e344a9 Merge pull request #153 from danielbayerlein/ruby-version
Looks good to me, thanks!
2016-12-24 12:03:51 -05:00
Daniel Bayerlein
a6194dfe8b Update RSpec 2016-12-23 11:59:44 +01:00
Daniel Bayerlein
5692194fa2 Add support for Ruby 2.2.6 and 2.3.3 2016-12-23 11:37:47 +01:00
Daniel Bayerlein
11745098c2 Support Ruby 2.1.0, 2.2.0, 2.3.0 2016-12-23 11:23:11 +01:00
Denis Yantarev
b1bb0c996c Add Ruby 2.2 & 2.3 to Travis config and fix GEM dependencies 2016-12-05 03:34:57 +03:00
Denis Yantarev
a62039da50 Ignore rbenv configuration files 2016-12-05 03:34:14 +03:00
Denis Yantarev
4bfd1c60c2 Fix default option value type warning 2016-12-03 15:56:22 +03:00
Jeremy Cook
f0e11abb5b Merge pull request #149 from mail6543210/master
Use source content instead of source path (fixes: #148). Thanks for fixing this!
2016-01-21 20:05:33 -05:00
mail6543210
ed397bdaf8 Use source content instead of source path (fixes: #148) 2016-01-21 18:36:52 +08:00
Jeremy Cook
2f5e20d963 Fixed formatting in Changelog file. 2015-10-31 09:54:41 -04:00
11 changed files with 182 additions and 109 deletions

3
.gitignore vendored
View File

@@ -48,3 +48,6 @@ Gemfile.lock
vendor/
homesick*.gem
# rbenv configuration
.ruby-version

View File

@@ -1,6 +1,6 @@
language: ruby
rvm:
- 2.1.0
- 2.0.0
- 1.9.3
- 2.4.0
- 2.3.3
- 2.2.6
sudo: false

View File

@@ -1,9 +1,24 @@
#1.1.6
* Makesure the FileUtils is imported correctly to avoid a potential error
* Fixes an issue where comparing a diff would not use the content of the new file
* Small documentation fixes
# 1.1.5
* Fixed problem with version number being incorrect.
# 1.1.4
* Make sure symlink conflicts are explicitly communicated to a user and symlinks are not silently overwritten
* Use real paths of symlinks when linking a castle into home
* Fix a problem when in a diff when asking a user to resolve a conflict
* Some code refactoring and fixes
# 1.1.3
* Allow a destinaton to be passed when cloning a castle
* Allow a destination to be passed when cloning a castle
* Make sure `homesick edit` opens default editor in the root of the given castle
* Fixed bug when diffing edited files
* Fixed crashing bug when attempting to diff directories
* Ensure that messages are escaped correctly on `git commit all`
# 1.1.2
* Added '--force' option to the rc command to bypass confirmation checks when running a .homesickrc file
* Added a check to make sure that a minimum of Git 1.8.0 is installed. This stops Homesick failing silently if Git is not installed.

38
Gemfile
View File

@@ -1,28 +1,36 @@
require 'rbconfig'
source 'https://rubygems.org'
this_ruby = Gem::Version.new(RUBY_VERSION)
ruby_230 = Gem::Version.new('2.3.0')
# Add dependencies required to use your gem here.
gem "thor", ">= 0.14.0"
gem 'thor', '>= 0.14.0'
# Add dependencies to develop your gem here.
# Include everything needed to run rake, tests, features, etc.
group :development do
gem "rake", ">= 0.8.7"
gem "rspec", "~> 3.1.0"
gem "guard"
gem "guard-rspec"
gem "rb-readline", "~> 0.5.0"
gem "jeweler", ">= 1.6.2"
gem 'capture-output', '~> 1.0.0'
gem 'coveralls', require: false
gem "test_construct"
gem "capture-output", "~> 1.0.0"
if RbConfig::CONFIG['host_os'] =~ /linux|freebsd|openbsd|sunos|solaris/
gem 'guard'
gem 'guard-rspec'
gem 'jeweler', '>= 1.6.2', '< 2.2' if this_ruby < ruby_230
gem 'jeweler', '>= 1.6.2' if this_ruby >= ruby_230
gem 'rake', '>= 0.8.7'
gem 'rb-readline', '~> 0.5.0'
gem 'rspec', '~> 3.5.0'
gem 'rubocop'
gem 'test_construct'
install_if -> { RUBY_PLATFORM =~ /linux|freebsd|openbsd|sunos|solaris/ } do
gem 'libnotify'
end
if RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
gem 'terminal-notifier-guard', '~> 1.6.1'
install_if -> { RUBY_PLATFORM =~ /darwin/ } do
gem 'terminal-notifier-guard', '~> 1.7.0'
end
if RUBY_VERSION >= '1.9.2'
gem "rubocop"
install_if -> { this_ruby < ruby_230 } do
gem 'listen', '< 3'
gem 'rack', '< 2'
end
end

View File

@@ -30,7 +30,7 @@ Alternatively, if it's on github, there's a slightly shorter way:
With the castle cloned, you can now link its contents into your home dir:
homesick symlink pickled-vim
homesick link pickled-vim
You can remove symlinks anytime when you don't need them anymore
@@ -84,7 +84,7 @@ If you ever want to see what version of homesick you have type:
## .homesick_subdir
`homesick symlink` basically makes symlink to only first depth in `castle/home`. If you want to link nested files/directories, please use .homesick_subdir.
`homesick link` basically makes symlink to only first depth in `castle/home`. If you want to link nested files/directories, please use .homesick_subdir.
For example, when you have castle like this:
@@ -114,7 +114,7 @@ castle/.homesick_subdir
.config
and run `homesick symlink CASTLE`. The result is:
and run `homesick link CASTLE`. The result is:
~
|-- .config
@@ -164,9 +164,9 @@ and castle
Homesick is tested on the following Ruby versions:
* 1.9.3
* 2.0.0
* 2.1.0
* 2.2.6
* 2.3.3
* 2.4.0
## Note on Patches/Pull Requests

View File

@@ -2,19 +2,19 @@
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
# stub: homesick 1.1.3 ruby lib
# stub: homesick 1.1.6 ruby lib
Gem::Specification.new do |s|
s.name = "homesick"
s.version = "1.1.3"
s.name = "homesick".freeze
s.version = "1.1.6"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib"]
s.authors = ["Joshua Nichols", "Yusuke Murata"]
s.date = "2015-10-31"
s.description = "\n Your home directory is your castle. Don't leave your dotfiles behind.\n \n\n Homesick is sorta like rip, but for dotfiles. It uses git to clone a repository containing dotfiles, and saves them in ~/.homesick. It then allows you to symlink all the dotfiles into place with a single command. \n\n "
s.email = ["josh@technicalpickles.com", "info@muratayusuke.com"]
s.executables = ["homesick"]
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.authors = ["Joshua Nichols".freeze, "Yusuke Murata".freeze]
s.date = "2017-12-20"
s.description = "\n Your home directory is your castle. Don't leave your dotfiles behind.\n \n\n Homesick is sorta like rip, but for dotfiles. It uses git to clone a repository containing dotfiles, and saves them in ~/.homesick. It then allows you to symlink all the dotfiles into place with a single command. \n\n ".freeze
s.email = ["josh@technicalpickles.com".freeze, "info@muratayusuke.com".freeze]
s.executables = ["homesick".freeze]
s.extra_rdoc_files = [
"ChangeLog.markdown",
"LICENSE",
@@ -43,51 +43,63 @@ Gem::Specification.new do |s|
"spec/spec.opts",
"spec/spec_helper.rb"
]
s.homepage = "http://github.com/technicalpickles/homesick"
s.licenses = ["MIT"]
s.rubygems_version = "2.2.2"
s.summary = "Your home directory is your castle. Don't leave your dotfiles behind."
s.homepage = "http://github.com/technicalpickles/homesick".freeze
s.licenses = ["MIT".freeze]
s.rubygems_version = "2.6.11".freeze
s.summary = "Your home directory is your castle. Don't leave your dotfiles behind.".freeze
if s.respond_to? :specification_version then
s.specification_version = 4
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<thor>, [">= 0.14.0"])
s.add_development_dependency(%q<rake>, [">= 0.8.7"])
s.add_development_dependency(%q<rspec>, ["~> 3.1.0"])
s.add_development_dependency(%q<guard>, [">= 0"])
s.add_development_dependency(%q<guard-rspec>, [">= 0"])
s.add_development_dependency(%q<rb-readline>, ["~> 0.5.0"])
s.add_development_dependency(%q<jeweler>, [">= 1.6.2"])
s.add_development_dependency(%q<coveralls>, [">= 0"])
s.add_development_dependency(%q<test_construct>, [">= 0"])
s.add_development_dependency(%q<capture-output>, ["~> 1.0.0"])
s.add_development_dependency(%q<rubocop>, [">= 0"])
s.add_runtime_dependency(%q<thor>.freeze, [">= 0.14.0"])
s.add_development_dependency(%q<capture-output>.freeze, ["~> 1.0.0"])
s.add_development_dependency(%q<coveralls>.freeze, [">= 0"])
s.add_development_dependency(%q<guard>.freeze, [">= 0"])
s.add_development_dependency(%q<guard-rspec>.freeze, [">= 0"])
s.add_development_dependency(%q<jeweler>.freeze, [">= 1.6.2"])
s.add_development_dependency(%q<rake>.freeze, [">= 0.8.7"])
s.add_development_dependency(%q<rb-readline>.freeze, ["~> 0.5.0"])
s.add_development_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
s.add_development_dependency(%q<rubocop>.freeze, [">= 0"])
s.add_development_dependency(%q<test_construct>.freeze, [">= 0"])
s.add_development_dependency(%q<libnotify>.freeze, [">= 0"])
s.add_development_dependency(%q<terminal-notifier-guard>.freeze, ["~> 1.7.0"])
s.add_development_dependency(%q<listen>.freeze, ["< 3"])
s.add_development_dependency(%q<rack>.freeze, ["< 2"])
else
s.add_dependency(%q<thor>, [">= 0.14.0"])
s.add_dependency(%q<rake>, [">= 0.8.7"])
s.add_dependency(%q<rspec>, ["~> 3.1.0"])
s.add_dependency(%q<guard>, [">= 0"])
s.add_dependency(%q<guard-rspec>, [">= 0"])
s.add_dependency(%q<rb-readline>, ["~> 0.5.0"])
s.add_dependency(%q<jeweler>, [">= 1.6.2"])
s.add_dependency(%q<coveralls>, [">= 0"])
s.add_dependency(%q<test_construct>, [">= 0"])
s.add_dependency(%q<capture-output>, ["~> 1.0.0"])
s.add_dependency(%q<rubocop>, [">= 0"])
s.add_dependency(%q<thor>.freeze, [">= 0.14.0"])
s.add_dependency(%q<capture-output>.freeze, ["~> 1.0.0"])
s.add_dependency(%q<coveralls>.freeze, [">= 0"])
s.add_dependency(%q<guard>.freeze, [">= 0"])
s.add_dependency(%q<guard-rspec>.freeze, [">= 0"])
s.add_dependency(%q<jeweler>.freeze, [">= 1.6.2"])
s.add_dependency(%q<rake>.freeze, [">= 0.8.7"])
s.add_dependency(%q<rb-readline>.freeze, ["~> 0.5.0"])
s.add_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
s.add_dependency(%q<rubocop>.freeze, [">= 0"])
s.add_dependency(%q<test_construct>.freeze, [">= 0"])
s.add_dependency(%q<libnotify>.freeze, [">= 0"])
s.add_dependency(%q<terminal-notifier-guard>.freeze, ["~> 1.7.0"])
s.add_dependency(%q<listen>.freeze, ["< 3"])
s.add_dependency(%q<rack>.freeze, ["< 2"])
end
else
s.add_dependency(%q<thor>, [">= 0.14.0"])
s.add_dependency(%q<rake>, [">= 0.8.7"])
s.add_dependency(%q<rspec>, ["~> 3.1.0"])
s.add_dependency(%q<guard>, [">= 0"])
s.add_dependency(%q<guard-rspec>, [">= 0"])
s.add_dependency(%q<rb-readline>, ["~> 0.5.0"])
s.add_dependency(%q<jeweler>, [">= 1.6.2"])
s.add_dependency(%q<coveralls>, [">= 0"])
s.add_dependency(%q<test_construct>, [">= 0"])
s.add_dependency(%q<capture-output>, ["~> 1.0.0"])
s.add_dependency(%q<rubocop>, [">= 0"])
s.add_dependency(%q<thor>.freeze, [">= 0.14.0"])
s.add_dependency(%q<capture-output>.freeze, ["~> 1.0.0"])
s.add_dependency(%q<coveralls>.freeze, [">= 0"])
s.add_dependency(%q<guard>.freeze, [">= 0"])
s.add_dependency(%q<guard-rspec>.freeze, [">= 0"])
s.add_dependency(%q<jeweler>.freeze, [">= 1.6.2"])
s.add_dependency(%q<rake>.freeze, [">= 0.8.7"])
s.add_dependency(%q<rb-readline>.freeze, ["~> 0.5.0"])
s.add_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
s.add_dependency(%q<rubocop>.freeze, [">= 0"])
s.add_dependency(%q<test_construct>.freeze, [">= 0"])
s.add_dependency(%q<libnotify>.freeze, [">= 0"])
s.add_dependency(%q<terminal-notifier-guard>.freeze, ["~> 1.7.0"])
s.add_dependency(%q<listen>.freeze, ["< 3"])
s.add_dependency(%q<rack>.freeze, ["< 2"])
end
end

View File

@@ -42,7 +42,7 @@ module Homesick
end
def ln_s(source, destination)
source = Pathname.new(source)
source = Pathname.new(source).realpath
destination = Pathname.new(destination)
FileUtils.mkdir_p destination.dirname
@@ -63,16 +63,14 @@ module Homesick
case action
when :identical
say_status :identical, destination.expand_path, :blue
when :symlink_conflict
when :symlink_conflict, :conflict
if action == :conflict
say_status :conflict, "#{destination} exists", :red
else
say_status :conflict,
"#{destination} exists and points to #{destination.readlink}",
:red
FileUtils.rm destination
FileUtils.ln_s source, destination, force: true unless options[:pretend]
when :conflict
say_status :conflict, "#{destination} exists", :red
end
if collision_accepted?(destination, source)
FileUtils.rm_r destination, force: true unless options[:pretend]
FileUtils.ln_s source, destination, force: true unless options[:pretend]

View File

@@ -1,4 +1,5 @@
# -*- encoding : utf-8 -*-
require 'fileutils'
require 'thor'
module Homesick
@@ -27,13 +28,13 @@ module Homesick
# Hack in support for diffing symlinks
# Also adds support for checking if destination or content is a directory
shell_metaclass = class << shell; self; end
shell_metaclass.send(:define_method, :show_diff) do |destination, content|
shell_metaclass.send(:define_method, :show_diff) do |destination, source|
destination = Pathname.new(destination)
content = Pathname.new(content)
return 'Unable to create diff: destination or content is a directory' if destination.directory? || content.directory?
return super(destination, content) unless destination.symlink?
source = Pathname.new(source)
return 'Unable to create diff: destination or content is a directory' if destination.directory? || source.directory?
return super(destination, File.binread(source)) unless destination.symlink?
say "- #{destination.readlink}", :red, true
say "+ #{content.expand_path}", :green, true
say "+ #{source.expand_path}", :green, true
end
end
@@ -66,6 +67,7 @@ module Homesick
desc 'rc CASTLE', 'Run the .homesickrc for the specified castle'
method_option :force,
type: :boolean,
default: false,
desc: 'Evaluate .homesickrc without prompting.'
def rc(name = DEFAULT_CASTLE_NAME)
@@ -128,6 +130,7 @@ module Homesick
desc 'link CASTLE', 'Symlinks all dotfiles from the specified castle'
method_option :force,
type: :boolean,
default: false,
desc: 'Overwrite existing conflicting symlinks without prompting.'
def link(name = DEFAULT_CASTLE_NAME)

View File

@@ -4,9 +4,9 @@ require 'pathname'
module Homesick
# Various utility methods that are used by Homesick
module Utils
QUIETABLE = ['say_status']
QUIETABLE = [:say_status]
PRETENDABLE = ['system']
PRETENDABLE = [:system]
QUIETABLE.each do |method_name|
define_method(method_name) do |*args|
@@ -37,7 +37,7 @@ module Homesick
def check_castle_existance(name, action)
return if castle_dir(name).exist?
say_status :error,
"Could not #{action} #{name}, expected #{castle_dir(name)} exist and contain dotfiles",
"Could not #{action} #{name}, expected #{castle_dir(name)} to exist and contain dotfiles",
:red
exit(1)
end

View File

@@ -5,7 +5,7 @@ module Homesick
module Version
MAJOR = 1
MINOR = 1
PATCH = 3
PATCH = 6
STRING = [MAJOR, MINOR, PATCH].compact.join('.')
end

View File

@@ -146,7 +146,7 @@ describe Homesick::CLI do
it 'throws an exception when trying to clone a malformed uri like malformed' do
expect(homesick).not_to receive(:git_clone)
expect { homesick.clone 'malformed' }.to raise_error
expect { homesick.clone 'malformed' }.to raise_error(RuntimeError)
end
it 'clones a github repo' do
@@ -331,6 +331,40 @@ describe Homesick::CLI do
expect(home.join('.some_dotfile').readlink).to eq(dotfile)
end
end
context 'when call and some files conflict' do
it 'shows differences for conflicting text files' do
contents = {:castle => 'castle has new content', :home => 'home already has content'}
dotfile = castle.file('text')
File.open(dotfile.to_s, 'w') do |f|
f.write contents[:castle]
end
File.open(home.join('text').to_s, 'w') do |f|
f.write contents[:home]
end
message = Capture.stdout { homesick.shell.show_diff(home.join('text'), dotfile) }
expect(message.b).to match(/- ?#{contents[:home]}\n.*\+ ?#{contents[:castle]}$/m)
end
it 'shows message or differences for conflicting binary files' do
# content which contains NULL character, without any parentheses, braces, ...
contents = {:castle => (0..255).step(30).map{|e| e.chr}.join(), :home => (0..255).step(30).reverse_each.map{|e| e.chr}.join()}
dotfile = castle.file('binary')
File.open(dotfile.to_s, 'w') do |f|
f.write contents[:castle]
end
File.open(home.join('binary').to_s, 'w') do |f|
f.write contents[:home]
end
message = Capture.stdout { homesick.shell.show_diff(home.join('binary'), dotfile) }
if homesick.shell.is_a?(Thor::Shell::Color)
expect(message.b).to match(/- ?#{contents[:home]}\n.*\+ ?#{contents[:castle]}$/m)
elsif homesick.shell.is_a?(Thor::Shell::Basic)
expect(message.b).to match(/^Binary files .+ differ$/)
end
end
end
end
describe 'unlink' do
@@ -499,7 +533,7 @@ describe Homesick::CLI do
it 'prints an error message when trying to pull a non-existant castle' do
expect(homesick).to receive('say_status').once
.with(:error,
/Could not pull castle_repo, expected .* exist and contain dotfiles/,
/Could not pull castle_repo, expected .* to exist and contain dotfiles/,
:red)
expect { homesick.pull 'castle_repo' }.to raise_error(SystemExit)
end
@@ -529,7 +563,7 @@ describe Homesick::CLI do
it 'prints an error message when trying to push a non-existant castle' do
expect(homesick).to receive('say_status').once
.with(:error, /Could not push castle_repo, expected .* exist and contain dotfiles/, :red)
.with(:error, /Could not push castle_repo, expected .* to exist and contain dotfiles/, :red)
expect { homesick.push 'castle_repo' }.to raise_error(SystemExit)
end
end
@@ -687,7 +721,7 @@ describe Homesick::CLI do
it 'returns an error message when the given castle does not exist' do
expect(homesick).to receive('say_status').once
.with(:error, /Could not cd castle_repo, expected .* exist and contain dotfiles/, :red)
.with(:error, /Could not cd castle_repo, expected .* to exist and contain dotfiles/, :red)
expect { homesick.cd 'castle_repo' }.to raise_error(SystemExit)
end
end
@@ -716,7 +750,7 @@ describe Homesick::CLI do
# Set a default just in case none is set
allow(ENV).to receive(:[]).with('EDITOR').and_return('vim')
allow(homesick).to receive('say_status').once
.with(:error, /Could not open castle_repo, expected .* exist and contain dotfiles/, :red)
.with(:error, /Could not open castle_repo, expected .* to exist and contain dotfiles/, :red)
expect { homesick.open 'castle_repo' }.to raise_error(SystemExit)
end
end