Skip to content

Commit 98647b2

Browse files
committed
test: makes tests consistent
1 parent baa9f0f commit 98647b2

50 files changed

Lines changed: 815 additions & 667 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@
2121
*.attempt_*.webp
2222
*.diff.webp
2323
*.base.webp
24+
25+
test/fixtures/app/doc/screenshots/**/*.png
26+
test/fixtures/app/doc/screenshots/**/*.webp

Rakefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,24 @@ Rake::TestTask.new(:test) do |t|
1111
t.test_files = FileList["test/**/*_test.rb"]
1212
end
1313

14+
Rake::TestTask.new("test:unit") do |t|
15+
t.libs << "test"
16+
t.libs << "lib"
17+
t.test_files = FileList["test/unit/**/*_test.rb"]
18+
end
19+
1420
Rake::TestTask.new("test:integration") do |t|
1521
t.libs << "test"
1622
t.libs << "lib"
1723
t.test_files = FileList["test/integration/**/*_test.rb"]
1824
end
1925

26+
desc "Run all tests with coverage"
27+
task :coverage do
28+
ENV["COVERAGE"] = "true"
29+
Rake::Task["test"].invoke
30+
end
31+
2032
task "clobber" do
2133
puts "Cleanup tmp/*.png"
2234
FileUtils.rm_rf(Dir["./tmp/*"])

scripts/benchmark/find_region_benchmark.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
module Capybara::Screenshot::Diff
1010
class Drivers::FindRegionBenchmark
11-
TEST_IMAGES_DIR = Pathname.new(File.expand_path("../../test/images", __dir__))
11+
TEST_IMAGES_DIR = Pathname.new(File.expand_path("../../test/fixtures/images", __dir__))
1212
APP_SCREENSHOTS_DIR = Pathname.new(
1313
File.expand_path("../../test/fixtures/app/doc/screenshots/chrome/macos/", __dir__)
1414
)

test/capybara/screenshot/diff/area_calculator_test.rb

Lines changed: 0 additions & 24 deletions
This file was deleted.

test/capybara/screenshot/diff/comparison_loader_test.rb

Lines changed: 0 additions & 37 deletions
This file was deleted.

test/capybara/screenshot/diff/difference_finder_test.rb

Lines changed: 0 additions & 135 deletions
This file was deleted.

test/capybara/screenshot/diff/difference_test.rb

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)