Sha256: 5a7f68aac8f4d558204f5881e3d0009729a03eeaa868a755da09c1745fa8fa6f

Contents?: true

Size: 635 Bytes

Versions: 83

Compression:

Stored size: 635 Bytes

Contents

describe "Mock" do
  before do
    @mock = mock("test mock")
  end
  
  specify "when one example has an expectation (non-mock) inside the block passed to the mock" do
    @mock.should_receive(:msg) do |b|
      b.should be_true #this call exposes the problem
    end
    @mock.msg(false) rescue nil
  end
  
  specify "then the next example should behave as expected instead of saying" do
    @mock.should_receive(:foobar)
    @mock.foobar
    @mock.rspec_verify
    begin
      @mock.foobar
    rescue Exception => e
      e.message.should == "Mock 'test mock' received unexpected message :foobar with (no args)"
    end
  end 
end

Version data entries

83 entries across 83 versions & 12 rubygems

Version Path
jnstq-acts_as_sms-0.1.0 test/vendor/plugins/rspec/spec/spec/mocks/bug_report_10263_spec.rb
jnstq-acts_as_sms-0.1.1 test/vendor/plugins/rspec/spec/spec/mocks/bug_report_10263_spec.rb
jnstq-acts_as_sms-0.1.3 test/vendor/plugins/rspec/spec/spec/mocks/bug_report_10263_spec.rb
jnstq-acts_as_sms-0.1.4 test/vendor/plugins/rspec/spec/spec/mocks/bug_report_10263_spec.rb
newbamboo-evented-rspec-1.1.12 spec/spec/mocks/bug_report_10263_spec.rb
newbamboo-rspec-1.1.12 spec/spec/mocks/bug_report_10263_spec.rb
merb-core-1.1.3 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/mocks/bug_report_10263_spec.rb
merb-core-1.1.2 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/mocks/bug_report_10263_spec.rb
merb-core-1.1.1 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/mocks/bug_report_10263_spec.rb
merb-core-1.1.0 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/mocks/bug_report_10263_spec.rb
merb-core-1.1.0.rc1 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/mocks/bug_report_10263_spec.rb
merb-core-1.1.0.pre spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/mocks/bug_report_10263_spec.rb
mack-0.8.2 lib/gems/rspec-1.1.11/spec/spec/mocks/bug_report_10263_spec.rb
picolena-0.0.99 app_generators/picolena/templates/vendor/plugins/rspec/spec/spec/mocks/bug_report_10263.rb
picolena-0.1.1 rails_plugins/rspec/spec/spec/mocks/bug_report_10263.rb
picolena-0.1.0 rails_plugins/rspec/spec/spec/mocks/bug_report_10263.rb
picolena-0.1.2 rails_plugins/rspec/spec/spec/mocks/bug_report_10263.rb
picolena-0.1.3 rails_plugins/rspec/spec/spec/mocks/bug_report_10263.rb
picolena-0.1.4 rails_plugins/rspec/spec/spec/mocks/bug_report_10263.rb
picolena-0.1.5 rails_plugins/rspec/spec/spec/mocks/bug_report_10263.rb