adding all of botlist, initial add
[botlist.git] / openbotlist / WEB-INF / lib / ruby / rspec / spec / spec / mocks / bug_report_11545_spec.rb
blob8a334afa562cd8fe9530eabe756c7607ead9cdc1
1 require File.dirname(__FILE__) + '/../../spec_helper.rb'
3 class LiarLiarPantsOnFire
4   def respond_to?(sym)
5     true
6   end
7   
8   def self.respond_to?(sym)
9     true
10   end
11 end
12   
13 describe '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
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
31 end