Thanks, I was using another way before until I properly read through
the rspec doc.
I was doing this in another example:
let(:instance) { described_class.new() }
describe '
subject { instance.parse_log() }
its([:duration]){ should == mock_duration}
its([:owner]){ should == mock_editor}
I guess
On Jan 6, 12:55 am, David Chelimsky wrote:
> On Thu, Jan 5, 2012 at 5:45 PM, apneadiving
> wrote:
> > Hi,
>
> > After coding my app and enjoying a green wave of tests, I had horrible
> > feedback about some bugs.
>
> > Those bugs happened to some well tested parts of my app.
>
> > After some res
On Thu, Jan 5, 2012 at 5:45 PM, apneadiving wrote:
> Hi,
>
> After coding my app and enjoying a green wave of tests, I had horrible
> feedback about some bugs.
>
> Those bugs happened to some well tested parts of my app.
>
> After some research, I found out that
>
> get :index, :page => 2, :per_pa
Hi,
After coding my app and enjoying a green wave of tests, I had horrible
feedback about some bugs.
Those bugs happened to some well tested parts of my app.
After some research, I found out that
get :index, :page => 2, :per_page => 5
is different from:
get :index, :page => "2", :per_page =>
Why don't you use let:
describe MyClass do # Will set subject to an instance
of MyClass
context '#parse_input' do
let(:input) { subject.parse_input } # calling input in your specs will
now return the result of parse_input
it 'is a hash' do
input.shoul
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
...
end
but