Hello, how can i stub methods with the newer syntax? My current stub looks 
like

      dbl.stub(:raise_then_return) do
        @counter = @counter.to_i.succ
        raise RuntimeError if @counter < 2
        return "foo"
      end


and i get a deprecation warning

Deprecation Warnings:

Using `stub` from rspec-mocks' old `:should` syntax without explicitly 
enabling the syntax is deprecated. Use the new `:expect` syntax or 
explicitly enable `:should` instead.

The doc on Method stubs 
(https://www.relishapp.com/rspec/rspec-mocks/v/2-3/docs/method-stubs) has 
no equivalent for Rspec 3.5


What is the preferred way to express my stub? I need a method that raises on 
first call and then returns something on the second call.


Many thanks for considering my request.


-- 
You received this message because you are subscribed to the Google Groups 
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rspec/eb57df04-8ab3-4503-8c4e-89ab5c468e4a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to