Class: RSpec::Core::DRbOptions
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/drb.rb
Constant Summary collapse
- CONDITIONAL_FILTERS =
[:if, :unless]
Instance Method Summary collapse
- #add_error_exit_code(argv) ⇒ Object
- #add_failure_exit_code(argv) ⇒ Object
- #add_filter(argv, name, hash) ⇒ Object
- #add_formatters(argv) ⇒ Object
- #add_full_description(argv) ⇒ Object
- #add_libs(argv) ⇒ Object
- #add_requires(argv) ⇒ Object
-
#initialize(submitted_options, filter_manager) ⇒ DRbOptions
constructor
A new instance of DRbOptions.
- #options ⇒ Object
Constructor Details
#initialize(submitted_options, filter_manager) ⇒ DRbOptions
Returns a new instance of DRbOptions.
36 37 38 39 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/drb.rb', line 36 def initialize(, filter_manager) = @filter_manager = filter_manager end |
Instance Method Details
#add_error_exit_code(argv) ⇒ Object
71 72 73 74 75 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/drb.rb', line 71 def add_error_exit_code(argv) return unless [:error_exit_code] argv << "--error-exit-code" << [:error_exit_code].to_s end |
#add_failure_exit_code(argv) ⇒ Object
65 66 67 68 69 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/drb.rb', line 65 def add_failure_exit_code(argv) return unless [:failure_exit_code] argv << "--failure-exit-code" << [:failure_exit_code].to_s end |
#add_filter(argv, name, hash) ⇒ Object
91 92 93 94 95 96 97 98 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/drb.rb', line 91 def add_filter(argv, name, hash) hash.each_pair do |k, v| next if CONDITIONAL_FILTERS.include?(k) tag = name == :inclusion ? k.to_s : "~#{k}".dup tag << ":#{v}" if v.is_a?(String) argv << "--tag" << tag end unless hash.empty? end |
#add_formatters(argv) ⇒ Object
100 101 102 103 104 105 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/drb.rb', line 100 def add_formatters(argv) [:formatters].each do |pair| argv << "--format" << pair[0] argv << "--out" << pair[1] if pair[1] end if [:formatters] end |
#add_full_description(argv) ⇒ Object
77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/drb.rb', line 77 def add_full_description(argv) return unless [:full_description] # The argument to --example is regexp-escaped before being stuffed # into a regexp when received for the first time (see OptionParser). # Hence, merely grabbing the source of this regexp will retain the # backslashes, so we must remove them. [:full_description].each do |description| argv << "--example" << description.source.delete('\\') end end |
#add_libs(argv) ⇒ Object
107 108 109 110 111 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/drb.rb', line 107 def add_libs(argv) [:libs].each do |path| argv << "-I" << path end if [:libs] end |
#add_requires(argv) ⇒ Object
113 114 115 116 117 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/drb.rb', line 113 def add_requires(argv) [:requires].each do |path| argv << "--require" << path end if [:requires] end |
#options ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/drb.rb', line 41 def argv = [] argv << "--color" if [:color] argv << "--force-color" if [:color_mode] == :on argv << "--no-color" if [:color_mode] == :off argv << "--profile" if [:profile_examples] argv << "--backtrace" if [:full_backtrace] argv << "--tty" if [:tty] argv << "--fail-fast" if [:fail_fast] argv << "--options" << [:custom_options_file] if [:custom_options_file] argv << "--order" << [:order] if [:order] add_failure_exit_code(argv) add_error_exit_code(argv) add_full_description(argv) add_filter(argv, :inclusion, @filter_manager.inclusions) add_filter(argv, :exclusion, @filter_manager.exclusions) add_formatters(argv) add_libs(argv) add_requires(argv) argv + [:files_or_directories_to_run] end |