Sha256: 1f23d20febc31cef8ee515cfa8deb84b48781960494fb4c1d3bc0be46197d9d9

Contents?: true

Size: 860 Bytes

Versions: 7

Compression:

Stored size: 860 Bytes

Contents

require 'spec_helper'
require 'gorillib/object/try_dup'

describe 'try_dup', :simple_spec => true do
  it "returns a duplicate version on regular objects" do
    obj = Object.new
    oth = obj.try_dup
    obj.should_not === oth
  end

  it "returns self on Numerics" do
    obj = 12
    oth = obj.try_dup
    obj.should === oth
  end

  it "returns self on Symbols" do
    obj = :test
    oth = obj.try_dup
    obj.should === oth
  end

  it "returns self on true" do
    obj = true
    oth = obj.try_dup
    obj.should === oth
  end

  it "returns self on false" do
    obj = false
    oth = obj.try_dup
    obj.should === oth
  end

  it "returns self on nil" do
    obj = nil
    oth = obj.try_dup
    obj.should === oth
  end

  it "returns self on modules" do
    obj = Module.new
    oth = obj.try_dup
    obj.object_id.should == oth.object_id
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
gorillib-0.6.0 spec/gorillib/object/try_dup_spec.rb
gorillib-0.5.2 spec/gorillib/object/try_dup_spec.rb
gorillib-0.5.0 spec/gorillib/object/try_dup_spec.rb
gorillib-0.4.2 spec/gorillib/object/try_dup_spec.rb
gorillib-0.4.2pre spec/gorillib/object/try_dup_spec.rb
gorillib-0.4.0pre spec/gorillib/object/try_dup_spec.rb
gorillib-0.4.1pre spec/gorillib/object/try_dup_spec.rb