Sha256: f19847e847257124dbf68ba8ece0f4a594488cea2c71a6b5564cc97451f17a41

Contents?: true

Size: 625 Bytes

Versions: 5

Compression:

Stored size: 625 Bytes

Contents

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

describe 'Stubbing Error' do

  behaves_like 'has standard setup'

  it 'should not be raised when stubbing module' do
    should.not.raise(CrossStub::Error) {
      AnyModule.xstub(:say_hello => 'i say hello')
    }
  end

  it 'should not be raised when stubbing class' do
    should.not.raise(CrossStub::Error) {
      AnyClass.xstub(:say_hello => 'i say hello')
    }
  end

  it 'should be raised when stubbing instance' do
    should.raise(CrossStub::CannotStubInstanceError) do
      o = AnyClass.new
      o.xstub(:say_hello => 'i say hello')
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cross-stub-0.1.3.1 spec/cross-stub/stubbing_error_spec.rb
cross-stub-0.1.3 spec/cross-stub/stubbing_error_spec.rb
cross-stub-0.1.2 spec/cross-stub/stubbing_error_spec.rb
cross-stub-0.1.1 spec/cross-stub/stubbing_error_spec.rb
cross-stub-0.1.0 spec/cross-stub/stubbing_error_spec.rb