1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
# frozen_string_literal: true
require "pry"
require "tmuxinator"
require "factory_bot"
FactoryBot.find_definitions
# Custom Matchers
require_relative "matchers/pane_matcher"
RSpec.configure do |config|
config.order = "random"
end
# Copied from minitest.
def capture_io
require "stringio"
captured_stdout = StringIO.new
captured_stderr = StringIO.new
orig_stdout = $stdout
orig_stderr = $stderr
$stdout = captured_stdout
$stderr = captured_stderr
yield
[captured_stdout.string, captured_stderr.string]
ensure
$stdout = orig_stdout
$stderr = orig_stderr
end
def tmux_config(options = {})
standard_options = [
"assume-paste-time 1",
"bell-action any",
"bell-on-alert off",
]
if base_index = options.fetch(:base_index, 1)
standard_options << "base-index #{base_index}"
end
if pane_base_index = options.fetch(:pane_base_index, 1)
standard_options << "pane-base-index #{pane_base_index}"
end
"echo '#{standard_options.join("\n")}'"
end
|