Sha256: 35fa185dd0dd12674c922766b4e9bd91f25e7cda75c329676fd9f33e4057be94

Contents?: true

Size: 537 Bytes

Versions: 14

Compression:

Stored size: 537 Bytes

Contents

describe "Object" do
  before do
    @source = Object.new
    @source.instance_variable_set(:@bar, 'bar')
    @source.instance_variable_set(:@baz, 'baz')
  end
  
  describe "instance_variable_names" do
    it "should return all instance variable names" do
      @source.instance_variable_names.sort.should == %w(@bar @baz)
    end
  end
  
  describe "instance_values" do
    it "should return the values of all instance variables as a hash" do
      @source.instance_values.should == {'bar' => 'bar', 'baz' => 'baz'}
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
motion-support-1.2.1 spec/motion-support/core_ext/object/instance_variable_spec.rb
motion-support-1.1.1 spec/motion-support/core_ext/object/instance_variable_spec.rb
motion-support-1.2.0 spec/motion-support/core_ext/object/instance_variable_spec.rb
motion-support-1.1.0 spec/motion-support/core_ext/object/instance_variable_spec.rb
motion-support-1.0.0 spec/motion-support/core_ext/object/instance_variable_spec.rb
motion-support-0.3.0 spec/motion-support/core_ext/object/instance_variable_spec.rb
motion_blender-support-0.2.8 spec/motion-support/core_ext/object/instance_variable_spec.rb
motion_blender-support-0.2.7 spec/motion-support/core_ext/object/instance_variable_spec.rb
motion-support-0.2.6 spec/motion-support/core_ext/object/instance_variable_spec.rb
motion-support-0.2.5 spec/motion-support/core_ext/object/instance_variable_spec.rb
motion-support-0.2.4 spec/motion-support/core_ext/object/instance_variable_spec.rb
motion-support-0.2.3 spec/motion-support/core_ext/object/instance_variable_spec.rb
motion-support-0.2.2 spec/motion-support/core_ext/object/instance_variable_spec.rb
motion-support-0.2.0 spec/motion-support/core_ext/object/instance_variable_spec.rb