From 245da7eb5f8023840eab6ce7d5739d792b7a2bed Mon Sep 17 00:00:00 2001 From: Uwe Kubosch Date: Mon, 30 Dec 2024 21:24:11 +0100 Subject: [PATCH] Silence CI warnings for missing assertions. Include `mutex_m` for test with RubyMine. --- gems.rb | 12 +++++++----- test/capybara/screenshot/diff/image_compare_test.rb | 2 +- test/capybara/screenshot/diff/screenshoter_test.rb | 6 +++--- .../screenshot/diff/stable_screenshoter_test.rb | 2 +- test/capybara/screenshot/diff/test_methods_test.rb | 4 ++-- test/capybara/screenshot/diff_test.rb | 1 + 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/gems.rb b/gems.rb index e8d1ee5e..63fee9fa 100644 --- a/gems.rb +++ b/gems.rb @@ -12,11 +12,13 @@ gem "oily_png", platform: :ruby, git: "https://github.com/wvanbergen/oily_png", ref: "44042006e79efd42ce4b52c1d78a4c70f0b4b1b2" gem "ruby-vips", require: false -# Test -gem "minitest", require: false -gem "minitest-stub-const", require: false -gem "simplecov", require: false -gem "rspec", require: false +group :test do + gem 'mutex_m' # Needed for RubyMine + gem "minitest", require: false + gem "minitest-stub-const", require: false + gem "simplecov", require: false + gem "rspec", require: false +end # Capybara Server gem "puma", require: false diff --git a/test/capybara/screenshot/diff/image_compare_test.rb b/test/capybara/screenshot/diff/image_compare_test.rb index eac0d597..88df28fa 100644 --- a/test/capybara/screenshot/diff/image_compare_test.rb +++ b/test/capybara/screenshot/diff/image_compare_test.rb @@ -60,7 +60,7 @@ class ImageCompareTest < ActionDispatch::IntegrationTest end test "could pass use tolerance for chunky_png driver" do - ImageCompare.new("images/b.png", "images/b.base.png", driver: :chunky_png, tolerance: 0.02) + assert ImageCompare.new("images/b.png", "images/b.base.png", driver: :chunky_png, tolerance: 0.02) end test "it can be instantiated with dimensions" do diff --git a/test/capybara/screenshot/diff/screenshoter_test.rb b/test/capybara/screenshot/diff/screenshoter_test.rb index 1d354390..ad534ac3 100644 --- a/test/capybara/screenshot/diff/screenshoter_test.rb +++ b/test/capybara/screenshot/diff/screenshoter_test.rb @@ -21,7 +21,7 @@ class ScreenshoterTest < ActionDispatch::IntegrationTest end end - mock.verify + assert mock.verify end test "#take_screenshot with custom screenshot options" do @@ -39,13 +39,13 @@ class ScreenshoterTest < ActionDispatch::IntegrationTest end end - mock.verify + assert mock.verify end test "#prepare_page_for_screenshot without wait does not raise any error" do screenshoter = Screenshoter.new({wait: nil}, ::Minitest::Mock.new) - screenshoter.prepare_page_for_screenshot(timeout: nil) # does not raise an error + assert_nil screenshoter.prepare_page_for_screenshot(timeout: nil) # does not raise an error end end end diff --git a/test/capybara/screenshot/diff/stable_screenshoter_test.rb b/test/capybara/screenshot/diff/stable_screenshoter_test.rb index d651e54a..9473e1e7 100644 --- a/test/capybara/screenshot/diff/stable_screenshoter_test.rb +++ b/test/capybara/screenshot/diff/stable_screenshoter_test.rb @@ -31,7 +31,7 @@ class StableScreenshoterTest < ActionDispatch::IntegrationTest take_stable_screenshot_with(snap) end - mock.verify + assert mock.verify end test "#take_stable_screenshot without wait raises any error" do diff --git a/test/capybara/screenshot/diff/test_methods_test.rb b/test/capybara/screenshot/diff/test_methods_test.rb index 010399b3..47865fdc 100644 --- a/test/capybara/screenshot/diff/test_methods_test.rb +++ b/test/capybara/screenshot/diff/test_methods_test.rb @@ -49,7 +49,7 @@ def test_assert_image_not_changed_with_shift_distance_limit def test_screenshot_support_drivers_options skip "vips is disabled" unless defined?(Capybara::Screenshot::Diff::Drivers::VipsDriverTest) - screenshot("a", driver: :vips) + assert_not screenshot("a", driver: :vips) end def test_skip_stack_frames @@ -76,7 +76,7 @@ def test_skip_stack_frames end def test_skip_area_and_stability_time_limit - screenshot(:a, skip_area: [0, 0, 1, 1], stability_time_limit: 0.01) + assert_not screenshot(:a, skip_area: [0, 0, 1, 1], stability_time_limit: 0.01) end def test_creates_new_screenshot diff --git a/test/capybara/screenshot/diff_test.rb b/test/capybara/screenshot/diff_test.rb index cd6edd0a..5093c350 100644 --- a/test/capybara/screenshot/diff_test.rb +++ b/test/capybara/screenshot/diff_test.rb @@ -150,6 +150,7 @@ def _test_sample_screenshot_error @test_screenshots = [] @test_screenshots << [["my_test.rb:42"], "sample_screenshot", mock] mock.expect(:clear_screenshots, @test_screenshots) + assert true end end