method
subject
1.3.1 -
Show latest stable
-
0 notes -
Class: Spec::Example::Subject::ExampleGroupMethods
- 1.1.4
- 1.1.12
- 1.2.0 (0)
- 1.2.8 (0)
- 1.3.0 (38)
- 1.3.1 (0)
- What's this?
subject(&block)
public
Defines an explicit subject for an example group which can then be the implicit receiver (through delegation) of calls to should.
Examples
describe CheckingAccount, "with $50" do subject { CheckingAccount.new(:amount => 50, :currency => :USD) } it { should have_a_balance_of(50, :USD) } it { should_not be_overdrawn } its(:currency) { should == :USD } end
See +ExampleMethods#should+ for more information about this approach.