summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtool/sync_default_gems.rb2
-rwxr-xr-xtool/test/test_sync_default_gems.rb18
2 files changed, 18 insertions, 2 deletions
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb
index a7785a989c..d2c17f35af 100755
--- a/tool/sync_default_gems.rb
+++ b/tool/sync_default_gems.rb
@@ -600,7 +600,7 @@ module SyncDefaultGems
puts "Remove files added to toplevel: #{toplevels.join(', ')}"
system(*%w"git rm -r --", *toplevels)
end
- tools = changed.select {|f|f.start_with?("test/lib/", "tool/")}
+ tools = changed.select {|f|f.start_with?("test/fixtures/", "test/lib/", "tool/")}
unless tools.empty?
system(*%W"git rm -r --", *tools)
system(*%W"git checkout HEAD~ --", *tools)
diff --git a/tool/test/test_sync_default_gems.rb b/tool/test/test_sync_default_gems.rb
index aa72dcfb20..e6c654ed55 100755
--- a/tool/test/test_sync_default_gems.rb
+++ b/tool/test/test_sync_default_gems.rb
@@ -96,7 +96,9 @@ module Test_SyncDefaultGems
if dir == "src"
Dir.mkdir("#{dir}/lib")
File.write("#{dir}/lib/fine.rb", "return\n")
- system(*%W"git add lib/fine.rb", exception: true, chdir: dir)
+ Dir.mkdir("#{dir}/test")
+ File.write("#{dir}/test/test_fine.rb", "return\n")
+ system(*%W"git add lib/fine.rb test/test_fine.rb", exception: true, chdir: dir)
system(*%W"git commit -q -m", "Looks fine", exception: true, chdir: dir)
end
Dir.mkdir("#{dir}/tool")
@@ -154,6 +156,20 @@ module Test_SyncDefaultGems
assert_equal(@sha["src"], IO.popen(%W[git log --format=%H -1], chdir: "src", &:read).chomp, out)
end
+ def test_skip_test_fixtures
+ Dir.mkdir("#@target/test")
+ Dir.mkdir("#@target/test/fixtures")
+ File.write("#@target/test/fixtures/fixme.rb", "")
+ system(*%W"git add test/fixtures/fixme.rb", exception: true, chdir: @target)
+ system(*%W"git commit -q -m", "Add fitures", exception: true, chdir: @target)
+ out = capture_process_output_to([STDOUT, STDERR]) do
+ Dir.chdir("src") do
+ SyncDefaultGems.sync_default_gems_with_commits(@target, ["#{@sha[@target]}..#{@target}/default"])
+ end
+ end
+ assert_equal(@sha["src"], IO.popen(%W[git log --format=%H -1], chdir: "src", &:read).chomp, out)
+ end
+
def test_skip_toplevel
Dir.mkdir("#@target/docs")
File.write("#@target/docs/NEWS.md", "= NEWS!!!\n")