-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathRakefile
More file actions
32 lines (26 loc) · 728 Bytes
/
Rakefile
File metadata and controls
32 lines (26 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# frozen_string_literal: true
require "bundler/gem_tasks"
require "shellwords"
task default: :test
task :test do
system("rm -rf ./test-output")
system("cp -r ./test-input ./test-output")
system("ruby -Ilib/ ./bin/magic_frozen_string_literal ./test-output/")
success = true
count = 0
successes = 0
Dir.glob("test-expected/*").each do |filename|
count += 1
escaped_args = [filename, "./test-output/#{File.basename(filename)}"].map { |word| Shellwords.shellescape(word) }
if system("diff -c #{escaped_args.join(' ')}")
successes += 1
end
end
puts "#{successes} of #{count} tests passed"
if successes == count
system("rm -rf ./test-output")
exit 0
else
exit 1
end
end