Sha256: c16984c94e8714797dfeb7c464f6da038eafaeece107b9c3800aa5543514b66a

Contents?: true

Size: 692 Bytes

Versions: 25

Compression:

Stored size: 692 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper.rb'

class LiarLiarPantsOnFire
  def respond_to?(sym)
    true
  end
  
  def self.respond_to?(sym)
    true
  end
end
  
describe 'should_receive' do
  before(:each) do
    @liar = LiarLiarPantsOnFire.new
  end
  
  it "should work when object lies about responding to a method" do
    @liar.should_receive(:something)
    @liar.something
  end

  it 'should work when class lies about responding to a method' do
    LiarLiarPantsOnFire.should_receive(:something)
    LiarLiarPantsOnFire.something
  end
  
  it 'should cleanup after itself' do
    LiarLiarPantsOnFire.metaclass.instance_methods.should_not include("something")
  end
end

Version data entries

25 entries across 25 versions & 5 rubygems

Version Path
typo-5.0 vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb
typo-5.1.1 vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb
typo-5.1.2 vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb
typo-5.1.3 vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb
typo-5.1 vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb