Sha256: 1fb94cfe600c0336c2d60dd451109bfda4389d2703229e79749aeca00a251880

Contents?: true

Size: 705 Bytes

Versions: 11

Compression:

Stored size: 705 Bytes

Contents

require 'spec_helper'

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

  it 'works when class lies about responding to a method' do
    LiarLiarPantsOnFire.should_receive(:something)
    LiarLiarPantsOnFire.something
  end
  
  it 'cleans up after itself' do
    expect((class << LiarLiarPantsOnFire; self; end).instance_methods).not_to include("something")
  end
end

Version data entries

11 entries across 11 versions & 6 rubygems

Version Path
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/rspec-mocks-2.13.0/spec/rspec/mocks/bug_report_11545_spec.rb
sshp-0.0.2 vendor/ruby/1.9.1/gems/rspec-mocks-2.13.1/spec/rspec/mocks/bug_report_11545_spec.rb
sshp-0.0.1 vendor/ruby/1.9.1/gems/rspec-mocks-2.13.1/spec/rspec/mocks/bug_report_11545_spec.rb
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/rspec-mocks-2.13.1/spec/rspec/mocks/bug_report_11545_spec.rb
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/rspec-mocks-2.13.1/spec/rspec/mocks/bug_report_11545_spec.rb
rspec-mocks-2.13.1 spec/rspec/mocks/bug_report_11545_spec.rb
vagrant-actionio-0.0.9 vendor/bundle/gems/rspec-mocks-2.13.0/spec/rspec/mocks/bug_report_11545_spec.rb
rspec-mocks-2.13.0 spec/rspec/mocks/bug_report_11545_spec.rb
remq-0.0.4 vendor/bundle/gems/rspec-mocks-2.12.2/spec/rspec/mocks/bug_report_11545_spec.rb
remq-0.0.3 vendor/bundle/gems/rspec-mocks-2.12.2/spec/rspec/mocks/bug_report_11545_spec.rb
rspec-mocks-2.12.2 spec/rspec/mocks/bug_report_11545_spec.rb