Sha256: b0bbf4e703db055cd18457eb09012184affac71811ddb6777eaa56c6ff1c2782

Contents?: true

Size: 697 Bytes

Versions: 38

Compression:

Stored size: 697 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

38 entries across 38 versions & 8 rubygems

Version Path
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/bug_report_11545_spec.rb
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/bug_report_11545_spec.rb
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/bug_report_11545_spec.rb
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/bug_report_11545_spec.rb
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/bug_report_11545_spec.rb
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/bug_report_11545_spec.rb
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/bug_report_11545_spec.rb
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/bug_report_11545_spec.rb
rspec-mocks-2.99.4 spec/rspec/mocks/bug_report_11545_spec.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/rspec-mocks-2.14.6/spec/rspec/mocks/bug_report_11545_spec.rb
rspec-mocks-2.99.3 spec/rspec/mocks/bug_report_11545_spec.rb
rspec-mocks-2.99.2 spec/rspec/mocks/bug_report_11545_spec.rb
dxruby_rp5-0.0.4 spec/vendor/rspec-mocks-2.14.4/spec/rspec/mocks/bug_report_11545_spec.rb
rspec-mocks-2.99.1 spec/rspec/mocks/bug_report_11545_spec.rb
rspec-mocks-2.99.0 spec/rspec/mocks/bug_report_11545_spec.rb
rspec-mocks-2.99.0.rc1 spec/rspec/mocks/bug_report_11545_spec.rb
rspec-mocks-2.14.6 spec/rspec/mocks/bug_report_11545_spec.rb
rspec-mocks-2.99.0.beta2 spec/rspec/mocks/bug_report_11545_spec.rb
rspec-mocks-2.14.5 spec/rspec/mocks/bug_report_11545_spec.rb
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/rspec-mocks-2.14.4/spec/rspec/mocks/bug_report_11545_spec.rb