[rspec-users] Can I set subject to its own method call?

m mcha226 at gmail.com
Thu Jan 5 04:26:22 EST 2012

The symbol "subject" by default is an instance of the described class.
In some method testing I often want to set the subject to be a method
call to the instance, for example "city.parse_input()".

I tried to do

describe '#parse_input' do
subject{ subject.parse_input() } #returns hash

but I can't.

I want to ask where did I get the semantic of this subject command
wrong which prevent me from doing this. Thanks.

More information about the rspec-users mailing list