changelog shortlog tags changeset manifest revisions annotate raw

vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.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
1require File.dirname(__FILE__) + '/../../spec_helper.rb'
2
3class LiarLiarPantsOnFire
4 def respond_to?(sym)
5 true
6 end
7
8 def self.respond_to?(sym)
9 true
10 end
11end
12
13describe 'should_receive' do
14 before(:each) do
15 @liar = LiarLiarPantsOnFire.new
16 end
17
18 it "should work when object lies about responding to a method" do
19 @liar.should_receive(:something)
20 @liar.something
21 end
22
23 it 'should work when class lies about responding to a method' do
24 LiarLiarPantsOnFire.should_receive(:something)
25 LiarLiarPantsOnFire.something
26 end
27
28 it 'should cleanup after itself' do
29 LiarLiarPantsOnFire.metaclass.instance_methods.should_not include("something")
30 end
31end