Skip to content

Commit

Permalink
rdoc - use the {name} syntax for links [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed May 19, 2012
1 parent acf2fdf commit d024dc9
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 24 deletions.
2 changes: 1 addition & 1 deletion lib/rspec/core/dsl.rb
Expand Up @@ -2,7 +2,7 @@ module RSpec
module Core
# Adds the `describe` method to the top-level namespace.
module DSL
# Generates a subclass of [ExampleGroup](ExampleGroup)
# Generates a subclass of {ExampleGroup}
#
# ## Examples:
#
Expand Down
17 changes: 7 additions & 10 deletions lib/rspec/core/example.rb
@@ -1,11 +1,9 @@
module RSpec
module Core
# Wrapper for an instance of a subclass of [ExampleGroup](ExampleGroup). An
# instance of `Example` is returned by the
# [example](ExampleGroup#example-instance_method) method exposed to
# examples, [before](Hooks#before-instance_method) and
# [after](Hooks#after-instance_method) hooks, and yielded to
# [around](Hooks#around-instance_method) hooks.
# Wrapper for an instance of a subclass of {ExampleGroup}. An instance of
# `Example` is returned by the {ExampleGroup#example example} method
# exposed to examples, {Hooks#before before} and {Hooks#after after} hooks,
# and yielded to {Hooks#around around} hooks.
#
# Useful for configuring logging and/or taking some action based
# on the state of an example's metadata.
Expand Down Expand Up @@ -99,7 +97,7 @@ def example_group

# @api private
# instance_evals the block passed to the constructor in the context of
# the instance of [ExampleGroup](../ExampleGroup).
# the instance of {ExampleGroup}.
# @param example_group_instance the instance of an ExampleGroup subclass
def run(example_group_instance, reporter)
@example_group_instance = example_group_instance
Expand Down Expand Up @@ -149,8 +147,7 @@ def self.procsy(metadata, &proc)
end

# Used to extend a `Proc` with behavior that makes it look something like
# an [Example](../Example) in an [around](../Hooks#around-instance_method)
# hook.
# an {Example} in an {Hooks#around around} hook.
#
# @note Procsy, itself, is not a public API, but we're documenting it
# here to document how to interact with the object yielded to an
Expand All @@ -167,7 +164,7 @@ def self.procsy(metadata, &proc)
# end
# end
module Procsy
# The `metadata` of the [Example](../Example) instance.
# The `metadata` of the {Example} instance.
attr_reader :metadata

# @api private
Expand Down
10 changes: 5 additions & 5 deletions lib/rspec/core/example_group.rb
@@ -1,6 +1,6 @@
module RSpec
module Core
# ExampleGroup and [Example](Example) are the main structural elements of
# ExampleGroup and {Example} are the main structural elements of
# rspec-core. Consider this example:
#
# describe Thing do
Expand Down Expand Up @@ -69,7 +69,7 @@ def #{name}(desc=nil, *args, &block)
define_example_method :example
# Defines an example within a group.
#
# @see ExampleGroup::example
# @see example
define_example_method :it
# Defines an example within a group.
# This is here primarily for backward compatibility with early versions
Expand Down Expand Up @@ -191,7 +191,7 @@ def self.metadata
end

# @private
# @return [Metadata] belonging to the parent of a nested [ExampleGroup](ExampleGroup)
# @return [Metadata] belonging to the parent of a nested {ExampleGroup}
def self.superclass_metadata
@superclass_metadata ||= self.superclass.respond_to?(:metadata) ? self.superclass.metadata : nil
end
Expand Down Expand Up @@ -443,11 +443,11 @@ def self.set_ivars(instance, ivars)
end

# @attr_reader
# Returns the [Example](Example) object that wraps this instance of
# Returns the {Example} object that wraps this instance of
# `ExampleGroup`
attr_accessor :example

# @deprecated use [example](ExampleGroup#example-instance_method)
# @deprecated use {ExampleGroup#example}
def running_example
RSpec.deprecate("running_example", "example")
example
Expand Down
11 changes: 5 additions & 6 deletions lib/rspec/core/hooks.rb
Expand Up @@ -126,12 +126,11 @@ def hooks
#
# Declare a block of code to be run before each example (using `:each`)
# or once before any example (using `:all`). These are usually declared
# directly in the [ExampleGroup](ExampleGroup) to which they apply, but
# they can also be shared across multiple groups.
# directly in the {ExampleGroup} to which they apply, but they can also
# be shared across multiple groups.
#
# You can also use `before(:suite)` to run a block of code before any
# example groups are run. This should be declared in
# [RSpec.configure](../../RSpec#configure-class_method)
# example groups are run. This should be declared in {RSpec.configure}
#
# Instance variables declared in `before(:each)` or `before(:all)` are
# accessible within each example.
Expand Down Expand Up @@ -232,7 +231,7 @@ def hooks
# rspec-rails, but it will not be wrapped in a transaction for you, so
# you are on your own to clean up in an `after(:all)` block.
#
# @example before(:each) declared in an [ExampleGroup](ExampleGroup)
# @example before(:each) declared in an {ExampleGroup}
#
# describe Thing do
# before(:each) do
Expand All @@ -244,7 +243,7 @@ def hooks
# end
# end
#
# @example before(:all) declared in an [ExampleGroup](ExampleGroup)
# @example before(:all) declared in an {ExampleGroup}
#
# describe Parser do
# before(:all) do
Expand Down
4 changes: 2 additions & 2 deletions lib/rspec/core/shared_context.rb
@@ -1,7 +1,7 @@
module RSpec
module Core
# Exposes [ExampleGroup](ExampleGroup)-level methods to a module, so you
# can include that module in an [ExampleGroup](ExampleGroup).
# Exposes {ExampleGroup}-level methods to a module, so you can include that
# module in an {ExampleGroup}.
#
# @example
#
Expand Down

0 comments on commit d024dc9

Please sign in to comment.