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
deckshuffler-0.0.2 vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb
picolena-0.0.99 app_generators/picolena/templates/vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb
picolena-0.1.0 rails_plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb
picolena-0.1.1 rails_plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb
picolena-0.1.3 rails_plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb
picolena-0.1.2 rails_plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb
picolena-0.1.4 rails_plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb
picolena-0.1.5 rails_plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb
rspec-1.1.1 spec/spec/mocks/bug_report_11545_spec.rb
rspec-1.0.6 spec/spec/mocks/bug_report_11545_spec.rb
rspec-1.0.8 spec/spec/mocks/bug_report_11545_spec.rb
rspec-1.1.0 spec/spec/mocks/bug_report_11545_spec.rb
rspec-1.0.7 spec/spec/mocks/bug_report_11545_spec.rb
rspec-1.1.2 spec/spec/mocks/bug_report_11545_spec.rb
rspec-1.1.3 spec/spec/mocks/bug_report_11545_spec.rb
spree-0.2.0 vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb
typo-5.0.2 vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb
typo-5.0.1 vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb
typo-5.0.3.98.1 vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb
typo-5.0.3.98 vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb