Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the flaky test for spec/rubocop/capybara/description_extractor_spec.rb #130

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

ydah
Copy link
Member

@ydah ydah commented Aug 19, 2024

RuboCop::Capybara::DescriptionExtractor
  builds a hash of descriptions (FAILED - 1)

Failures:

  1) RuboCop::Capybara::DescriptionExtractor builds a hash of descriptions
     Failure/Error:
       expect(described_class.new(yardocs).to_h).to eql(
         'Capybara/Foo'          => { 'Description' => 'Checks foo' },
         'Capybara/Undocumented' => { 'Description' => ''           }
       )

       expected: {"Capybara/Foo"=>{"Description"=>"Checks foo"}, "Capybara/Undocumented"=>{"Description"=>""}}
            got: {"Capybara/AmbiguousClick"=>{"Description"=>"Specify the exact target to click on."}, "Capybara/Click..."Capybara/VisibilityMatcher"=>{"Description"=>"Checks for boolean visibility in Capybara finders."}}

       (compared using eql?)

       Diff:

       @@ -1,3 +1,16 @@
       +"Capybara/AmbiguousClick" => {"Description"=>"Specify the exact target to click on."},
       +"Capybara/ClickLinkOrButtonStyle" => {"Description"=>"Checks for methods of button or link clicks."},
       +"Capybara/CurrentPathExpectation" => {"Description"=>"Checks that no expectations are set on Capybara's `current_path`."},
       +"Capybara/FindAllFirst" => {"Description"=>"Enforces use of `first` instead of `all` with `first` or `[0]`."},
        "Capybara/Foo" => {"Description"=>"Checks foo"},
       +"Capybara/MatchStyle" => {"Description"=>"Checks for usage of deprecated style methods."},
       +"Capybara/NegationMatcher" => {"Description"=>"Enforces use of `have_no_*` or `not_to` for negated expectations."},
       +"Capybara/RSpec/HaveSelector" => {"Description"=>"Use `have_css` or `have_xpath` instead of `have_selector`."},
       +"Capybara/RSpec/PredicateMatcher" => {"Description"=>"Prefer using predicate matcher over using predicate method directly."},
       +"Capybara/RedundantWithinFind" => {"Description"=>"Checks for redundant `within find(...)` calls."},
       +"Capybara/SpecificActions" => {"Description"=>"Checks for there is a more specific actions offered by Capybara."},
       +"Capybara/SpecificFinders" => {"Description"=>"Checks if there is a more specific finder offered by Capybara."},
       +"Capybara/SpecificMatcher" => {"Description"=>"Checks for there is a more specific matcher offered by Capybara."},
        "Capybara/Undocumented" => {"Description"=>""},
       +"Capybara/VisibilityMatcher" => {"Description"=>"Checks for boolean visibility in Capybara finders."},

     # ./spec/rubocop/capybara/description_extractor_spec.rb:66:in `block (2 levels) in <top (required)>'

Finished in 0.33675 seconds (files took 0.6663 seconds to load)
381 examples, 1 failure

Failed examples:

rspec ./spec/rubocop/capybara/description_extractor_spec.rb:65 # RuboCop::Capybara::DescriptionExtractor builds a hash of descriptions

Randomized with seed 30192

Before submitting the PR make sure the following are checked:

  • Feature branch is up-to-date with main (if not - rebase it).
  • Squashed related commits together.
  • [-] Added tests.
  • [-] Updated documentation.
  • [-] Added an entry to the CHANGELOG.md if the new code introduces user-observable changes.
  • The build (bundle exec rake) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).

@ydah ydah requested a review from a team as a code owner August 19, 2024 07:29
…ec.rb

```
RuboCop::Capybara::DescriptionExtractor
  builds a hash of descriptions (FAILED - 1)

Failures:

  1) RuboCop::Capybara::DescriptionExtractor builds a hash of descriptions
     Failure/Error:
       expect(described_class.new(yardocs).to_h).to eql(
         'Capybara/Foo'          => { 'Description' => 'Checks foo' },
         'Capybara/Undocumented' => { 'Description' => ''           }
       )

       expected: {"Capybara/Foo"=>{"Description"=>"Checks foo"}, "Capybara/Undocumented"=>{"Description"=>""}}
            got: {"Capybara/AmbiguousClick"=>{"Description"=>"Specify the exact target to click on."}, "Capybara/Click..."Capybara/VisibilityMatcher"=>{"Description"=>"Checks for boolean visibility in Capybara finders."}}

       (compared using eql?)

       Diff:

       @@ -1,3 +1,16 @@
       +"Capybara/AmbiguousClick" => {"Description"=>"Specify the exact target to click on."},
       +"Capybara/ClickLinkOrButtonStyle" => {"Description"=>"Checks for methods of button or link clicks."},
       +"Capybara/CurrentPathExpectation" => {"Description"=>"Checks that no expectations are set on Capybara's `current_path`."},
       +"Capybara/FindAllFirst" => {"Description"=>"Enforces use of `first` instead of `all` with `first` or `[0]`."},
        "Capybara/Foo" => {"Description"=>"Checks foo"},
       +"Capybara/MatchStyle" => {"Description"=>"Checks for usage of deprecated style methods."},
       +"Capybara/NegationMatcher" => {"Description"=>"Enforces use of `have_no_*` or `not_to` for negated expectations."},
       +"Capybara/RSpec/HaveSelector" => {"Description"=>"Use `have_css` or `have_xpath` instead of `have_selector`."},
       +"Capybara/RSpec/PredicateMatcher" => {"Description"=>"Prefer using predicate matcher over using predicate method directly."},
       +"Capybara/RedundantWithinFind" => {"Description"=>"Checks for redundant `within find(...)` calls."},
       +"Capybara/SpecificActions" => {"Description"=>"Checks for there is a more specific actions offered by Capybara."},
       +"Capybara/SpecificFinders" => {"Description"=>"Checks if there is a more specific finder offered by Capybara."},
       +"Capybara/SpecificMatcher" => {"Description"=>"Checks for there is a more specific matcher offered by Capybara."},
        "Capybara/Undocumented" => {"Description"=>""},
       +"Capybara/VisibilityMatcher" => {"Description"=>"Checks for boolean visibility in Capybara finders."},

     # ./spec/rubocop/capybara/description_extractor_spec.rb:66:in `block (2 levels) in <top (required)>'

Finished in 0.33675 seconds (files took 0.6663 seconds to load)
381 examples, 1 failure

Failed examples:

rspec ./spec/rubocop/capybara/description_extractor_spec.rb:65 # RuboCop::Capybara::DescriptionExtractor builds a hash of descriptions

Randomized with seed 30192
```
Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@ydah ydah merged commit f501b34 into main Aug 19, 2024
26 checks passed
@ydah ydah deleted the fix-flaky-test branch August 19, 2024 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants