Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit a1813f0

Browse files
authored
Merge pull request #2505 from garettarrowood/add_yard_return_values_in_configuration
[#2494] Add yard return values to Rspec::Core::Configuration
2 parents b836d71 + 8e0e97b commit a1813f0

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

lib/rspec/core/configuration.rb

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def self.add_read_only_setting(name, opts={})
100100
#
101101
# @note Other scripts invoking `rspec` indirectly will ignore this
102102
# setting.
103+
# @return [String]
103104
add_read_only_setting :default_path
104105
def default_path=(path)
105106
project_source_dirs << path
@@ -109,6 +110,7 @@ def default_path=(path)
109110
# @macro add_setting
110111
# Run examples over DRb (default: `false`). RSpec doesn't supply the DRb
111112
# server, but you can use tools like spork.
113+
# @return [Boolean]
112114
add_setting :drb
113115

114116
# @macro add_setting
@@ -121,6 +123,7 @@ def default_path=(path)
121123

122124
# Indicates if the DSL has been exposed off of modules and `main`.
123125
# Default: true
126+
# @return [Boolean]
124127
def expose_dsl_globally?
125128
Core::DSL.exposed_globally?
126129
end
@@ -197,24 +200,29 @@ def only_failures_but_not_configured?
197200

198201
# @macro add_setting
199202
# The exit code to return if there are any failures (default: 1).
203+
# @return [Integer]
200204
add_setting :failure_exit_code
201205

202206
# @macro add_setting
203207
# Whether or not to fail when there are no RSpec examples (default: false).
208+
# @return [Boolean]
204209
add_setting :fail_if_no_examples
205210

206211
# @macro define_reader
207212
# Indicates files configured to be required.
213+
# @return [Array<String>]
208214
define_reader :requires
209215

210216
# @macro define_reader
211217
# Returns dirs that have been prepended to the load path by the `-I`
212218
# command line option.
219+
# @return [Array<String>]
213220
define_reader :libs
214221

215222
# @macro add_setting
216223
# Determines where RSpec will send its output.
217224
# Default: `$stdout`.
225+
# @return [IO, String]
218226
define_reader :output_stream
219227

220228
# Set the output stream for reporter.
@@ -233,6 +241,7 @@ def output_stream=(value)
233241

234242
# @macro define_reader
235243
# Load files matching this pattern (default: `'**{,/*/**}/*_spec.rb'`).
244+
# @return [String]
236245
define_reader :pattern
237246

238247
# Set pattern to match files to load.
@@ -243,6 +252,7 @@ def pattern=(value)
243252

244253
# @macro define_reader
245254
# Exclude files matching this pattern.
255+
# @return [String]
246256
define_reader :exclude_pattern
247257

248258
# Set pattern to match files to exclude.
@@ -264,6 +274,7 @@ def exclude_pattern=(value)
264274
# @macro add_setting
265275
# Report the times for the slowest examples (default: `false`).
266276
# Use this to specify the number of examples to include in the profile.
277+
# @return [Boolean]
267278
add_setting :profile_examples
268279

269280
# @macro add_setting
@@ -318,6 +329,7 @@ def exclude_pattern=(value)
318329
# @macro add_setting
319330
# Don't print filter info i.e. "Run options: include {:focus=>true}"
320331
# (default `false`).
332+
# return [Boolean]
321333
add_setting :silence_filter_announcements
322334

323335
# @deprecated This config option was added in RSpec 2 to pave the way
@@ -386,16 +398,19 @@ def shared_context_metadata_behavior=(value)
386398
end
387399

388400
# Record the start time of the spec suite to measure load time.
401+
# return [Time]
389402
add_setting :start_time
390403

391404
# @macro add_setting
392405
# Use threadsafe options where available.
393406
# Currently this will place a mutex around memoized values such as let blocks.
407+
# return [Boolean]
394408
add_setting :threadsafe
395409

396410
# @macro add_setting
397411
# Maximum count of failed source lines to display in the failure reports.
398412
# (default `10`).
413+
# return [Integer]
399414
add_setting :max_displayed_failure_line_count
400415

401416
# @private
@@ -410,8 +425,7 @@ def shared_context_metadata_behavior=(value)
410425
# @private
411426
attr_reader :backtrace_formatter, :ordering_manager, :loaded_spec_files
412427

413-
# rubocop:disable Metrics/AbcSize
414-
# rubocop:disable Metrics/MethodLength
428+
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength
415429

416430
# Build an object to store runtime configuration options and set defaults
417431
def initialize
@@ -466,8 +480,7 @@ def initialize
466480

467481
define_built_in_hooks
468482
end
469-
# rubocop:enable Metrics/MethodLength
470-
# rubocop:enable Metrics/AbcSize
483+
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize
471484

472485
# @private
473486
#
@@ -548,6 +561,7 @@ def add_setting(name, opts={})
548561
end
549562

550563
# Returns the configured mock framework adapter module.
564+
# @return [Symbol]
551565
def mock_framework
552566
if @mock_framework.nil?
553567
begin
@@ -575,12 +589,13 @@ def mock_framework=(framework)
575589
# To override this behaviour and display a full backtrace, use
576590
# `--backtrace` on the command line, in a `.rspec` file, or in the
577591
# `rspec_options` attribute of RSpec's rake task.
592+
# @return [Array<Regexp>]
578593
def backtrace_exclusion_patterns
579594
@backtrace_formatter.exclusion_patterns
580595
end
581596

582597
# Set regular expressions used to exclude lines in backtrace.
583-
# @param patterns [Regexp] set the backtrace exlusion pattern
598+
# @param patterns [Array<Regexp>] set backtrace_formatter exlusion_patterns
584599
def backtrace_exclusion_patterns=(patterns)
585600
@backtrace_formatter.exclusion_patterns = patterns
586601
end
@@ -593,12 +608,13 @@ def backtrace_exclusion_patterns=(patterns)
593608
# will be included.
594609
#
595610
# You can modify the list via the getter, or replace it with the setter.
611+
# @return [Array<Regexp>]
596612
def backtrace_inclusion_patterns
597613
@backtrace_formatter.inclusion_patterns
598614
end
599615

600616
# Set regular expressions used to include lines in backtrace.
601-
# @attr patterns [Regexp] set backtrace_formatter inclusion_patterns
617+
# @attr patterns [Array<Regexp>] set backtrace_formatter inclusion_patterns
602618
def backtrace_inclusion_patterns=(patterns)
603619
@backtrace_formatter.inclusion_patterns = patterns
604620
end

0 commit comments

Comments
 (0)