Permalink
Browse files

doc tweaks [ci skip] #619

  • Loading branch information...
dchelimsky committed May 16, 2012
1 parent 19e1eaf commit 5ea6d86db35c93102e94a56dc6935663fa8d9afe
Showing with 6 additions and 5 deletions.
  1. +6 −5 lib/rspec/core/subject.rb
View
@@ -41,7 +41,6 @@ module ExampleMethods
#
# @see ExampleGroupMethods#subject
# @see #should
- #
def subject
if defined?(@original_subject)
@original_subject
@@ -171,18 +170,20 @@ def its(attribute, &block)
# implicitly in one-liners and explicitly using an intention revealing
# name.
#
- # @param [String,Symbol] name optional name
+ # @param [String,Symbol] name used to define an accessor with an
+ # intention revealing name
+ # @param block defines the value to be returned by `subject` in examples
#
# @example
#
# describe CheckingAccount, "with $50" do
- # subject { CheckingAccount.new(:amount => 50, :currency => :USD) }
- # it { should have_a_balance_of(50, :USD) }
+ # subject { CheckingAccount.new(Money.new(50, :USD)) }
+ # it { should have_a_balance_of(Money.new(50, :USD)) }
# it { should_not be_overdrawn }
# end
#
# describe CheckingAccount, "with a non-zero starting balance" do
- # subject(:account) { CheckingAccount.new(:amount => 50, :currency => :USD) }
+ # subject(:account) { CheckingAccount.new(Money.new(50, :USD)) }
# it { should_not be_overdrawn }
# it "has a balance equal to the starting balance" do
# account.balance.should eq(Money.new(50, :USD))

0 comments on commit 5ea6d86

Please sign in to comment.