Skip to content

Commit

Permalink
Merge pull request #1449 from rspec/match_core_to_expectations_mocks
Browse files Browse the repository at this point in the history
Make rspec-cores Gemfile match mocks/expectations setup for yard
  • Loading branch information
myronmarston committed Apr 6, 2014
2 parents b897913 + 170adbe commit e4e43d2
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ gemspec
end
end

gem 'yard', '~> 0.8.7', :require => false

### deps for rdoc.info
platforms :ruby do
gem 'yard', '0.8.6.1', :require => false
group :documentation do
gem 'redcarpet', '2.1.1'
gem 'github-markup', '0.7.2'
end
Expand Down
1 change: 1 addition & 0 deletions lib/rspec/core/backtrace_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module RSpec
module Core
# @private
class BacktraceFormatter
# @private
attr_accessor :exclusion_patterns, :inclusion_patterns

def initialize
Expand Down
5 changes: 3 additions & 2 deletions lib/rspec/core/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,11 @@ def self.add_read_only_setting(name, opts={})
end

# @macro [attach] add_setting
# @attribute $1
# @!attribute [rw] $1
# @!method $1=(value)
#
# @macro [attach] define_reader
# @attribute $1
# @!attribute [r] $1

# @macro add_setting
# Path to use if no path is provided to the `rspec` command (default:
Expand Down
9 changes: 8 additions & 1 deletion lib/rspec/core/formatters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,14 @@ def initialize(reporter)
@reporter = reporter
self.default_formatter = 'progress'
end
attr_reader :formatters, :reporter

# @return [Array] the loaded formatters
attr_reader :formatters

# @return [Reporter] the reporter
attr_reader :reporter

# @return [String] the default formatter to setup, defaults to `progress`
attr_accessor :default_formatter

# @private
Expand Down
26 changes: 26 additions & 0 deletions lib/rspec/core/formatters/base_text_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,22 @@ class BaseTextFormatter < BaseFormatter
Formatters.register self, :message, :dump_summary, :dump_failures,
:dump_pending, :seed

# @method message
# @api public
#
# Used by the reporter to send messages to the output stream.
#
# @param notification [MessageNotification] containing message
def message(notification)
output.puts notification.message
end

# @method dump_failures
# @api public
#
# Dumps detailed information about each example failure.
#
# @param notification [NullNotification]
def dump_failures(notification)
return if failed_examples.empty?
output.puts
Expand All @@ -29,6 +41,14 @@ def dump_failures(notification)
end
end

# @method dump_summary
# @api public
#
# This method is invoked after the dumping of examples and failures. Each parameter
# is assigned to a corresponding attribute.
#
# @param summary [SummaryNotification] containing duration, example_count,
# failure_count and pending_count
def dump_summary(summary)
dump_profile unless mute_profile_output?(summary.failure_count)
output.puts "\nFinished in #{format_duration(summary.duration)}" +
Expand Down Expand Up @@ -113,6 +133,12 @@ def seed(notification)
output.puts
end

# @api public
#
# Invoked at the very end, `close` allows the formatter to clean
# up resources, e.g. open streams, etc.
#
# @param notification [NullNotification]
def close(notification)
output.close if IO === output && output != $stdout
end
Expand Down
1 change: 1 addition & 0 deletions lib/rspec/core/world.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class World

include RSpec::Core::Hooks

# @private
attr_reader :example_groups, :filtered_examples

# Used internally to determine what to do when a SIGINT is received
Expand Down

0 comments on commit e4e43d2

Please sign in to comment.