spec/integration/remove_spec.rb in braid-1.0.22 vs spec/integration/remove_spec.rb in braid-1.1.0
- old
+ new
@@ -36,24 +36,46 @@
end
describe 'braiding a subdirectory in' do
before do
in_dir(@repository_dir) do
- run_command("#{BRAID_BIN} add #{@vendor_repository_dir} --path layouts")
+ run_command("#{BRAID_BIN} add #{@vendor_repository_dir} --path layouts skit-layouts")
end
end
it 'should remove the files and the remote' do
- assert_no_diff("#{FIXTURE_PATH}/skit1/layouts/layout.liquid", "#{@repository_dir}/skit1/layout.liquid")
+ assert_no_diff("#{FIXTURE_PATH}/skit1/layouts/layout.liquid", "#{@repository_dir}/skit-layouts/layout.liquid")
in_dir(@repository_dir) do
- run_command("#{BRAID_BIN} remove skit1")
+ run_command("#{BRAID_BIN} remove skit-layouts")
end
- expect(File.exist?("#{@repository_dir}/skit1)")).to eq(false)
+ expect(File.exist?("#{@repository_dir}/skit-layouts)")).to eq(false)
braids = YAML::load_file("#{@repository_dir}/.braids.json")
- expect(braids['skit1']).to be_nil
+ expect(braids['skit-layouts']).to be_nil
+ end
+ end
+
+ describe 'braiding a single file in' do
+ before do
+ in_dir(@repository_dir) do
+ run_command("#{BRAID_BIN} add #{@vendor_repository_dir} --path layouts/layout.liquid skit-layout.liquid")
+ end
+ end
+
+ it 'should remove the files and the remote' do
+
+ assert_no_diff("#{FIXTURE_PATH}/skit1/layouts/layout.liquid", "#{@repository_dir}/skit-layout.liquid")
+
+ in_dir(@repository_dir) do
+ run_command("#{BRAID_BIN} remove skit-layout.liquid")
+ end
+
+ expect(File.exist?("#{@repository_dir}/skit-layout.liquid)")).to eq(false)
+
+ braids = YAML::load_file("#{@repository_dir}/.braids.json")
+ expect(braids['skit-layout.liquid']).to be_nil
end
end
end