Specs for track

This commit is contained in:
Eric West
2013-05-20 21:06:31 -05:00
parent 49e4d2844b
commit 7332aa4acd

View File

@@ -169,5 +169,27 @@ describe "homesick" do
some_rc_file.readlink.should == tracked_file
end
it 'should track a file in nested folder structure' do
castle = given_castle('castle_repo')
some_nested_file = home.file('some/nested/file.txt')
homesick.track(some_nested_file.to_s, 'castle_repo')
tracked_file = castle.join('some/nested/file.txt')
tracked_file.should exist
some_nested_file.readlink.should == tracked_file
end
it 'should track a nested directory' do
castle = given_castle('castle_repo')
some_nested_dir = home.directory('some/nested/directory/')
homesick.track(some_nested_dir.to_s, 'castle_repo')
tracked_file = castle.join('some/nested/directory/')
tracked_file.should exist
File.realdirpath(some_nested_dir).should == File.realdirpath(tracked_file)
end
end
end