changelog shortlog tags changeset manifest revisions annotate raw

vendor/plugins/rspec/failing_examples/mocking_with_mocha.rb

changeset 15: 64acf98d15f4
author: moriq@moriq.com
date: Mon Mar 10 10:12:58 2008 +0900 (16 years ago)
permissions: -rw-r--r--
description: add plugins rspec
1# stub frameworks like to gum up Object, so this is deliberately
2# set NOT to run so that you don't accidentally run it when you
3# run this dir.
4
5# To run it, stand in this directory and say:
6#
7# RUN_MOCHA_EXAMPLE=true ruby ../bin/spec mocking_with_mocha.rb
8
9if ENV['RUN_MOCHA_EXAMPLE']
10 Spec::Runner.configure do |config|
11 config.mock_with :mocha
12 end
13 describe "Mocha framework" do
14 it "should should be made available by saying config.mock_with :mocha" do
15 m = mock()
16 m.expects(:msg).with("arg")
17 m.msg
18 end
19 it "should should be made available by saying config.mock_with :mocha" do
20 o = Object.new
21 o.expects(:msg).with("arg")
22 o.msg
23 end
24 end
25end