Sha256: f3dbefbf03b00f61c4c972b3e26ec10bf1218abb4dd1e1f1fd8cb785dcdda827

Contents?: true

Size: 743 Bytes

Versions: 35

Compression:

Stored size: 743 Bytes

Contents

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

class LiarLiarPantsOnFire
  include Spec::MetaClass
  extend Spec::MetaClass
  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

35 entries across 35 versions & 9 rubygems

Version Path
dchelimsky-rspec-1.1.10 spec/spec/mocks/bug_report_11545_spec.rb
dchelimsky-rspec-1.1.11 spec/spec/mocks/bug_report_11545_spec.rb
jnstq-acts_as_sms-0.1.0 test/vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb
jnstq-acts_as_sms-0.1.1 test/vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb
jnstq-acts_as_sms-0.1.3 test/vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb
jnstq-acts_as_sms-0.1.4 test/vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb
merb-core-1.1.3 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/mocks/bug_report_11545_spec.rb
merb-core-1.1.2 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/mocks/bug_report_11545_spec.rb
merb-core-1.1.1 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/mocks/bug_report_11545_spec.rb
merb-core-1.1.0 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/mocks/bug_report_11545_spec.rb
merb-core-1.1.0.rc1 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/mocks/bug_report_11545_spec.rb
merb-core-1.1.0.pre spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/mocks/bug_report_11545_spec.rb
mack-0.8.2 lib/gems/rspec-1.1.11/spec/spec/mocks/bug_report_11545_spec.rb
pictrails-0.5.0 vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb
radiant-0.6.5.1 vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb
radiant-0.6.5 vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb
radiant-0.6.7 vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb
radiant-0.6.6 vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb
radiant-0.6.8 vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb
radiant-0.6.9 vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb