Thoughts on development, design and the world we live in.

REPL Mocks in Rspec 2.9

By Curtis Jennings Schofield in Uncategorized. Posted on April 14th

REPL (Read-Eval-Print-Loop) is a great way to learn.

Sarah Allen has a great post on REPL and rspec.
Sarah’s Post on REPL Rspec

In Rspec 2.9 there is a nice way to get the standalone way working

$ irb
1.9.2p290 :001 > require 'rspec/mocks/standalone'
1.9.2p290 :002 > Time.stub(:now) {1}
1.9.2p290 :003 > Time.now
=> 1

One Trackback

  1. By repl rspec mocks | the evolving ultrasaurus on April 14, 2012 at 2:19 pm

    [...] [update for repl mocks for RSpec 2.9 by Curtis Schofield] [...]

Post a Comment

Your email is never shared. Required fields are marked *