Sha256: 7a0bfe04ae50b0124f8a20c4752c03fb2e712dae57dcb21949d2721f06f5ae4d

Contents?: true

Size: 816 Bytes

Versions: 4

Compression:

Stored size: 816 Bytes

Contents

require_relative '../../spec_helper'

class Empty
end

class MyClass
    attr_accessor :stuff
end

describe Object do

    describe '#deep_clone' do
        it 'should return a deep copy of the object' do
            a = [ [1,2] ]
            b = a.deep_clone
            a[0] << 3

            b.should == [ [1,2] ]
        end
    end

    describe '#realsize' do
        context 'when the class has instance variables' do
            it 'should return an integer > 0' do
                s = MyClass.new
                s.stuff = 'my stuff'
                s.realsize.should > 0
            end
        end
        context 'when the class has instance variables' do
            it 'should return nil' do
                s = Empty.new
                s.realsize.should == 0
            end
        end
    end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
arachni-0.4.1.3 spec/arachni/ruby/object_spec.rb
arachni-0.4.1.2 spec/arachni/ruby/object_spec.rb
arachni-0.4.1.1 spec/arachni/ruby/object_spec.rb
arachni-0.4.1 spec/arachni/ruby/object_spec.rb