refactor given_castle
This commit is contained in:
@@ -122,7 +122,7 @@ describe "homesick" do
|
||||
end
|
||||
|
||||
context "with '.config' in .homesick_subdir" do
|
||||
let(:castle) { given_castle("glencairn", "glencairn", [".config"]) }
|
||||
let(:castle) { given_castle("glencairn", [".config"]) }
|
||||
it "can symlink in sub directory" do
|
||||
dotdir = castle.directory(".config")
|
||||
dotfile = dotdir.file(".some_dotfile")
|
||||
@@ -136,7 +136,7 @@ describe "homesick" do
|
||||
end
|
||||
|
||||
context "with '.config/appA' in .homesick_subdir" do
|
||||
let(:castle) { given_castle("glencairn", "glencairn", [".config/appA"]) }
|
||||
let(:castle) { given_castle("glencairn", [".config/appA"]) }
|
||||
it "can symlink in nested sub directory" do
|
||||
dotdir = castle.directory(".config").directory("appA")
|
||||
dotfile = dotdir.file(".some_dotfile")
|
||||
@@ -153,7 +153,7 @@ describe "homesick" do
|
||||
describe "list" do
|
||||
it "should say each castle in the castle directory" do
|
||||
given_castle('zomg')
|
||||
given_castle('zomg', 'wtf/zomg')
|
||||
given_castle('wtf/zomg')
|
||||
|
||||
homesick.should_receive(:say_status).with("zomg", "git://github.com/technicalpickles/zomg.git", :cyan)
|
||||
homesick.should_receive(:say_status).with("wtf/zomg", "git://github.com/technicalpickles/zomg.git", :cyan)
|
||||
|
||||
@@ -16,7 +16,8 @@ RSpec.configure do |config|
|
||||
homesick.stub(:say_status)
|
||||
end
|
||||
|
||||
def given_castle(name, path=name, subdirs=[])
|
||||
def given_castle(path, subdirs=[])
|
||||
name = Pathname.new(path).basename
|
||||
castles.directory(path) do |castle|
|
||||
Dir.chdir(castle) do
|
||||
system "git init >/dev/null 2>&1"
|
||||
|
||||
Reference in New Issue
Block a user