Skip to content

Commit 7fc9a12

Browse files
committed
[rb] Allow focusing tests w/o extra args
1 parent 020521a commit 7fc9a12

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,6 @@ Supported browsers:
370370
* `safari-preview`
371371

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

rb/spec/integration/selenium/webdriver/spec_helper.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@
4545
GlobalTestEnv.quit_driver
4646
end
4747

48-
c.filter_run focus: true if ENV['focus']
48+
c.filter_run_when_matching :focus
49+
c.run_all_when_everything_filtered = true
50+
c.default_formatter = c.files_to_run.count > 1 ? 'progress' : 'doc'
4951

5052
c.before do |example|
5153
guards = WebDriver::Support::Guards.new(example, bug_tracker: 'https://github.com/SeleniumHQ/selenium/issues')

rb/spec/unit/selenium/webdriver/spec_helper.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ def with_env(hash)
5858

5959
c.include Selenium::WebDriver::UnitSpecHelper
6060

61-
c.filter_run focus: true if ENV['focus']
61+
c.filter_run_when_matching :focus
62+
c.run_all_when_everything_filtered = true
63+
c.default_formatter = c.files_to_run.count > 1 ? 'progress' : 'doc'
6264

6365
c.before do
6466
# https://github.com/ruby/debug/issues/797

0 commit comments

Comments
 (0)