]> git.openstreetmap.org Git - rails.git/blob - vendor/gems/rspec-1.1.2/spec/spec/mocks/bug_report_11545_spec.rb
Show whether a trace is public or private in the trace list, so that a user can easil...
[rails.git] / vendor / gems / rspec-1.1.2 / spec / spec / mocks / bug_report_11545_spec.rb
1 require File.dirname(__FILE__) + '/../../spec_helper.rb'
2
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
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
31 end