Sha256: f5a4ab1a5cee181ab1f343d55e631a30a63c23d7daf8cce74f3864f2bc842d8d

Contents?: true

Size: 783 Bytes

Versions: 9

Compression:

Stored size: 783 Bytes

Contents

require 'spec_helper'

class Empty
end

class MyClass
    attr_accessor :stuff
end

describe Object do

    describe '#deep_clone' do
        it 'returns 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 'returns 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 'returns nil' do
                s = Empty.new
                s.realsize.should == 0
            end
        end
    end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
arachni-0.4.7 spec/arachni/ruby/object_spec.rb
arachni-0.4.6 spec/arachni/ruby/object_spec.rb
arachni-0.4.5.2 spec/arachni/ruby/object_spec.rb
arachni-0.4.5.1 spec/arachni/ruby/object_spec.rb
arachni-0.4.5 spec/arachni/ruby/object_spec.rb
arachni-0.4.4 spec/arachni/ruby/object_spec.rb
arachni-0.4.3.2 spec/arachni/ruby/object_spec.rb
arachni-0.4.3.1 spec/arachni/ruby/object_spec.rb
arachni-0.4.3 spec/arachni/ruby/object_spec.rb