Rspec before block parameters?

I need to define before (: each) block for my rspec, but there are some variables in this block that should be defined by each example. I googled but did not see how to do this. Can someone give me an example?

before(:each) do
  subject.stub(:abc) {double(price: 11)}
end

Here 11 really should be the variable given by each example.

+4
source share

All Articles