Sha256: 5e0898526c44d9162c4fbab5771634bf8665e6c2b4dd3176ec12f4c2c6c2a9fe

Contents?: true

Size: 832 Bytes

Versions: 7

Compression:

Stored size: 832 Bytes

Contents

require 'spec_helper'

describe RSpecCandy::Helpers::ShouldReceiveAndExecute do

  describe Object do

    describe '#should_receive_and_execute' do

      it 'should not stub away the original method implementation' do
        object = "object"
        object.should_receive_and_execute(:size)
        object.size.should == 6
      end

      it 'should set an expectation that the given method are called' do
        (<<-example).should fail_as_example
          object = 'object'
          object.should_receive_and_execute(:size)
        example
      end

      it 'should return the expectation for further parameterization' do
        object = 'object'
        object.should_receive_and_execute(:size).class.name.should include('MessageExpectation')
        object.size # make the example pass
      end

    end

  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rspec_candy-0.2.3 spec/shared/rspec_candy/helpers/should_receive_and_execute_spec.rb
rspec_candy-0.2.2 spec/shared/rspec_candy/helpers/should_receive_and_execute_spec.rb
rspec_candy-0.2.1 spec/shared/rspec_candy/helpers/should_receive_and_execute_spec.rb
rspec_candy-0.2.0 spec/shared/rspec_candy/helpers/should_receive_and_execute_spec.rb
rspec_candy-0.1.2 spec/shared/rspec_candy/helpers/should_receive_and_execute_spec.rb
rspec_candy-0.1.1 spec/shared/rspec_candy/helpers/should_receive_and_execute_spec.rb
rspec_candy-0.1.0 spec/shared/rspec_candy/helpers/should_receive_and_execute_spec.rb