Skip to content

Commit

Permalink
Cleanup code styles
Browse files Browse the repository at this point in the history
  • Loading branch information
asavageiv authored and pftg committed Nov 16, 2023
1 parent fe828ad commit edb0481
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions test/capybara/screenshot/diff/test_methods_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,19 @@ def test_skip_stack_frames
assert_predicate @test_screenshots, :blank?
make_comparison(:a, :c, destination: Rails.root / "doc/screenshots/a.png")

our_screenshot("a", 1)
our_screenshot("a", 0)
assert_equal 1, @test_screenshots.size
unless ENV["RBS_TEST_TARGET"] # RBS generates new methods for checking types, so we do not know their names
assert_match(
/test_methods_test.rb:\d+:in `our_screenshot'/,
@test_screenshots.dig(0, 0, 0)
)
assert_match(/test_methods_test\.rb:\d+:in `our_screenshot'/, @test_screenshots[0][0])
end
assert_equal "a", @test_screenshots[0][1]

our_screenshot("a", 2)
our_screenshot("a", 1)
assert_equal 2, @test_screenshots.size
unless ENV["RBS_TEST_TARGET"] # RBS generates new methods for checking types, so we do not know their names
assert_match(
/test_methods_test.rb:.*?test_skip_stack_frames/,
@test_screenshots.dig(1, 0, 0)
/test_methods_test\.rb:.*?test_skip_stack_frames/, # RBS generates new methods for checking types, so we do not know their names
@test_screenshots[1][0]
)
end
assert_equal "a", @test_screenshots[1][1]
Expand Down

0 comments on commit edb0481

Please sign in to comment.