Sha256: 44a7e676ed5cb5ad52c40fa7060d25d463fbc05b2a132a3673722b2ec20d0e99

Contents?: true

Size: 701 Bytes

Versions: 134

Compression:

Stored size: 701 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
    (class << LiarLiarPantsOnFire; self; end).instance_methods.should_not include("something")
  end
end

Version data entries

134 entries across 83 versions & 13 rubygems

Version Path
classiccms-0.3.5 vendor/bundle/gems/rspec-mocks-2.9.0/spec/rspec/mocks/bug_report_11545_spec.rb
classiccms-0.3.5 vendor/bundle/gems/rspec-mocks-2.10.1/spec/rspec/mocks/bug_report_11545_spec.rb
classiccms-0.3.4 vendor/bundle/gems/rspec-mocks-2.9.0/spec/rspec/mocks/bug_report_11545_spec.rb
classiccms-0.3.4 vendor/bundle/gems/rspec-mocks-2.10.1/spec/rspec/mocks/bug_report_11545_spec.rb
classiccms-0.3.3 vendor/bundle/gems/rspec-mocks-2.10.1/spec/rspec/mocks/bug_report_11545_spec.rb
classiccms-0.3.3 vendor/bundle/gems/rspec-mocks-2.9.0/spec/rspec/mocks/bug_report_11545_spec.rb
classiccms-0.3.2 vendor/bundle/gems/rspec-mocks-2.10.1/spec/rspec/mocks/bug_report_11545_spec.rb
classiccms-0.3.2 vendor/bundle/gems/rspec-mocks-2.9.0/spec/rspec/mocks/bug_report_11545_spec.rb
classiccms-0.3.1 vendor/bundle/gems/rspec-mocks-2.10.1/spec/rspec/mocks/bug_report_11545_spec.rb
classiccms-0.3.1 vendor/bundle/gems/rspec-mocks-2.9.0/spec/rspec/mocks/bug_report_11545_spec.rb
classiccms-0.3.0 vendor/bundle/gems/rspec-mocks-2.9.0/spec/rspec/mocks/bug_report_11545_spec.rb
classiccms-0.3.0 vendor/bundle/gems/rspec-mocks-2.10.1/spec/rspec/mocks/bug_report_11545_spec.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/rspec-mocks-2.10.1/spec/rspec/mocks/bug_report_11545_spec.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-mocks-2.10.1/spec/rspec/mocks/bug_report_11545_spec.rb
rails-uploader-0.0.1 vendor/bundle/ruby/1.9.1/gems/rspec-mocks-2.10.1/spec/rspec/mocks/bug_report_11545_spec.rb
resque-pool-0.3.0 vendor/bundle/ruby/1.8/gems/rspec-mocks-2.9.0/spec/rspec/mocks/bug_report_11545_spec.rb
ftl-0.2.0 vendor/bundle/gems/rspec-mocks-2.10.1/spec/rspec/mocks/bug_report_11545_spec.rb
classiccms-0.2.4.pre vendor/bundle/gems/rspec-mocks-2.10.1/spec/rspec/mocks/bug_report_11545_spec.rb
classiccms-0.2.4.pre vendor/bundle/gems/rspec-mocks-2.9.0/spec/rspec/mocks/bug_report_11545_spec.rb
rspec-mocks-2.10.1 spec/rspec/mocks/bug_report_11545_spec.rb