Mock::Turtle

“What is the use of repeating all that stuff, if you don’t explain it as you go on? It’s by far the most confusing thing I ever heard!” The Mock Turtle, Alice in Wonderland

“It’s turtles all the way down.”

Example

# in a test
@something.stubs(:thing => Mock::Turtle.new)
@something.thing.foo.bar  #=> #<Mock::Turtle:0x12aecc4>

Why would I use this?

When your test doesn’t care what a dependency is ever going to do. Any method you call on a Mock::Turtle will just return another Mock::Turtle, so on and so forth.

Get it from Gemcutter

gem install mock_turtle

Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don’t break it in a future version unintentionally.
  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
  • Send me a pull request. Bonus points for topic branches.

Copyright

Copyright © 2010 Jeremy Weiskotten. See LICENSE for details.