Skip to content

Commit

Permalink
rdoc tweaks for deprecated example method and block argument
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Jun 19, 2013
1 parent d941ba7 commit 45d0e2b
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions lib/rspec/core/example_group.rb
Expand Up @@ -55,6 +55,7 @@ def description
# @param [String] name
# @param [Hash] extra_options
# @param [Block] implementation
# @yield [Example] the example object
def self.define_example_method(name, extra_options={})
define_method(name) do |*all_args, &block|
desc, *args = *all_args
Expand All @@ -67,10 +68,22 @@ def self.define_example_method(name, extra_options={})
end

# Defines an example within a group.
# @example
# example do
# end
#
# example "does something" do
# end
#
# example "does something", :with => 'addtional metadata' do
# end
#
# example "does something" do |ex|
# # ex is a wrapper for the current running example
# end
define_example_method :example
# Defines an example within a group.
#
# @see example
# @example
define_example_method :it
# Defines an example within a group.
# This is here primarily for backward compatibility with early versions
Expand All @@ -79,17 +92,23 @@ def self.define_example_method(name, extra_options={})
define_example_method :specify

# Shortcut to define an example with `:focus` => true
# @see example
define_example_method :focus, :focused => true, :focus => true
# Shortcut to define an example with `:focus` => true
# @see example
define_example_method :focused, :focused => true, :focus => true

# Shortcut to define an example with :pending => true
# @see example
define_example_method :pending, :pending => true
# Shortcut to define an example with :pending => 'Temporarily disabled with xexample'
# @see example
define_example_method :xexample, :pending => 'Temporarily disabled with xexample'
# Shortcut to define an example with :pending => 'Temporarily disabled with xit'
# @see example
define_example_method :xit, :pending => 'Temporarily disabled with xit'
# Shortcut to define an example with :pending => 'Temporarily disabled with xspecify'
# @see example
define_example_method :xspecify, :pending => 'Temporarily disabled with xspecify'

# Works like `alias_method :name, :example` with the added benefit of
Expand Down

0 comments on commit 45d0e2b

Please sign in to comment.