RSpec
rspec-osc7501 reports suite activity, progress, and results to a terminal supporting OSC 7501.
Add the gem to your Gemfile and install it:
group :test do
gem 'rspec'
gem 'rspec-osc7501', '~> 0.1.4'
end
bundle install
Select the OSC formatter alongside RSpec's progress formatter:
bundle exec rspec --require rspec/osc7501 \
--format progress --format RSpec::OSC7501::Formatter
The progress formatter keeps RSpec's dots, failures, and summary. Requiring rspec/osc7501 registers the formatter but does not select it.
# Output
RSPEC_OSC7501=auto is the default: report to the formatter's output stream when it is a TTY and TERM is not dumb. Set it to force to override both checks or off to disable output. Other mode values raise ArgumentError. RSPEC_OSC7501_TITLE sets the record title, which defaults to RSpec.
To inspect records without a supporting terminal, force output through a pipe:
RSPEC_OSC7501=force bundle exec rspec --require rspec/osc7501 \
--format progress --format RSpec::OSC7501::Formatter | cat -v
Look for ^[]7501; records. A completed run reports state=done without a failure condition or state=error on failure. An interrupt or early stop can report state=idle, subject to the failure precedence described in the behavior reference. Concurrent RSpec processes in one terminal overwrite the same record. A process terminated without formatter callbacks can leave its last status in place.
Version 0.1.4 targets MRI Ruby 2.1 or newer and rspec-core 3.6 or newer. Other Ruby engines are unverified. See the released gem and usage documentation.
# Project links
Source, Issues, Apache-2.0 license, Release, Behavior reference