Skip to content

Commit

Permalink
PR notes rspec#2 from @JonRowe
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Farhi committed Mar 6, 2014
1 parent b7d1f81 commit e114573
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
14 changes: 10 additions & 4 deletions lib/rspec/core/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def expose_dsl_globally=(value)
define_reader :output_stream

# Set the output stream for reporter
# Default $stdout
# @attr [IO] defaults to $stdout
def output_stream=(value)
if @reporter && !value.equal?(@output_stream)
warn "RSpec's reporter has already been initialized with " +
Expand All @@ -171,6 +171,7 @@ def output_stream=(value)
add_setting :pattern, :alias_with => :filename_pattern

# Set pattern matching files to load
# @attr [String] filename pattern to set
def pattern= value
if @spec_files_loaded
RSpec.warning "Configuring `pattern` to #{value} has no effect since RSpec has already loaded the spec files."
Expand Down Expand Up @@ -360,7 +361,8 @@ def backtrace_exclusion_patterns
@backtrace_formatter.exclusion_patterns
end

# Set Regexps used to exclude lines in backtrace
# Set regular expressions used to exclude lines in backtrace
# @attr [Regexp] backtrace_formatter.exclusion_patterns
def backtrace_exclusion_patterns=(patterns)
@backtrace_formatter.exclusion_patterns = patterns
end
Expand All @@ -377,7 +379,8 @@ def backtrace_inclusion_patterns
@backtrace_formatter.inclusion_patterns
end

# Set Regexps used to include lines in backtrace
# Set regular expressions used to include lines in backtrace
# @attr [Regexp] backtrace_formatter.inclusion_patterns
def backtrace_inclusion_patterns=(patterns)
@backtrace_formatter.inclusion_patterns = patterns
end
Expand Down Expand Up @@ -514,6 +517,7 @@ def expect_with(*frameworks)
end

# Check if full backtrace is enabled
# @return [Boolean] is backtrace enabled
def full_backtrace?
@backtrace_formatter.full_backtrace?
end
Expand Down Expand Up @@ -572,6 +576,7 @@ def line_numbers
end

# Run examples matching on `description` in all files to run.
# @attr [FilterManager] filter
def full_description=(description)
filter_run :full_description => Regexp.union(*Array(description).map {|d| Regexp.new(d) })
end
Expand Down Expand Up @@ -1058,7 +1063,8 @@ def warnings= value
$VERBOSE = !!value
end

# Get Ruby warnings
# Get Ruby warning verbosity
# @return [Fixnum] Ruby's warning level
def warnings
$VERBOSE
end
Expand Down
3 changes: 2 additions & 1 deletion lib/rspec/core/formatters/base_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def example_group_started(notification)
#
# Invoked at the beginning of the execution of each example.
#
# @param notification instance of subclass of `RSpec::Core::ExampleGroup`
# @param notification
# @option example subclass of `RSpec::Core::ExampleGroup`

This comment has been minimized.

Copy link
@JonRowe

JonRowe Mar 6, 2014

Oh, is that a valid YARD tag? Awesome /cc @myronmarston

This comment has been minimized.

Copy link
@myronmarston

myronmarston Mar 6, 2014

I've known about the @option yard tag for a while:

http://rubydoc.info/gems/yard/file/docs/Tags.md#option

...but it looks to me like it has no meaning in this context, because notification is not an options hash. It's a value object of whatever type @JonRowe defined.

This comment has been minimized.

Copy link
@JonRowe

JonRowe Mar 6, 2014

Doh

# @return [Array]
def example_started(notification)
examples << notification.example
Expand Down

0 comments on commit e114573

Please sign in to comment.