Skip to content

Commit

Permalink
[rb] Allow focusing tests w/o extra args
Browse files Browse the repository at this point in the history
  • Loading branch information
p0deje committed May 2, 2024
1 parent 020521a commit 7fc9a12
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ Supported browsers:
* `safari-preview`

In addition to the [Common Options Examples](#common-options-examples), here are some additional Ruby specific ones:
* `--test_arg "-tfocus"` - test only [focused specs](https://relishapp.com/rspec/rspec-core/v/3-12/docs/filtering/inclusion-filters)
* `--test_arg "-eTimeouts"` - test only specs which name include "Timeouts"
* `--test_arg "<any other RSpec argument>"` - pass any extra RSpec arguments (see `bazel run @bundle//bin:rspec -- --help`)

Expand Down
4 changes: 3 additions & 1 deletion rb/spec/integration/selenium/webdriver/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@
GlobalTestEnv.quit_driver
end

c.filter_run focus: true if ENV['focus']
c.filter_run_when_matching :focus
c.run_all_when_everything_filtered = true
c.default_formatter = c.files_to_run.count > 1 ? 'progress' : 'doc'

c.before do |example|
guards = WebDriver::Support::Guards.new(example, bug_tracker: 'https://github.com/SeleniumHQ/selenium/issues')
Expand Down
4 changes: 3 additions & 1 deletion rb/spec/unit/selenium/webdriver/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ def with_env(hash)

c.include Selenium::WebDriver::UnitSpecHelper

c.filter_run focus: true if ENV['focus']
c.filter_run_when_matching :focus
c.run_all_when_everything_filtered = true
c.default_formatter = c.files_to_run.count > 1 ? 'progress' : 'doc'

c.before do
# https://github.com/ruby/debug/issues/797
Expand Down

0 comments on commit 7fc9a12

Please sign in to comment.