Flowdock
method

subject

Importance_1
RSpec latest stable (1.3.1) - 0 notes - Class: Spec::Example::ExampleGroupMethods

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (1.1.12) is shown here.

These similar methods exist in 1.3.1:

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}
  end

See +ExampleMethods#should+ for more information about this approach.

Show source
Register or log in to add new notes.