Sha256: b074eb4926e98a7be86559e5ad10b3ae675e07c3781dbe2e3383f364c28f326a

Contents?: true

Size: 853 Bytes

Versions: 25

Compression:

Stored size: 853 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))

describe "try_dup" 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 = Extlib
    oth = obj.try_dup
    obj.object_id.should == oth.object_id
  end
end

Version data entries

25 entries across 24 versions & 5 rubygems

Version Path
sundbp-extlib-0.9.14 spec/try_dup_spec.rb
middleman-0.13.1 lib/middleman/vendor/gems/ruby/1.9.1/gems/extlib-0.9.14/spec/try_dup_spec.rb
middleman-0.13.1 lib/middleman/vendor/gems/ruby/1.8/gems/extlib-0.9.14/spec/try_dup_spec.rb
middleman-0.12.2 lib/middleman/vendor/gems/gems/extlib-0.9.14/spec/try_dup_spec.rb
middleman-0.12.1 lib/middleman/vendor/gems/gems/extlib-0.9.14/spec/try_dup_spec.rb
extlib-0.9.14 spec/try_dup_spec.rb
ginst-2009.12.8 vendor/gems/extlib-0.9.13/spec/try_dup_spec.rb
middleman-0.12.0.pre3 lib/middleman/vendor/gems/gems/extlib-0.9.13/spec/try_dup_spec.rb
middleman-0.12.0.pre2 lib/middleman/vendor/gems/gems/extlib-0.9.13/spec/try_dup_spec.rb
middleman-0.12.0.pre lib/middleman/vendor/gems/gems/extlib-0.9.13/spec/try_dup_spec.rb
ginst-2009.11.24 vendor/gems/extlib-0.9.13/spec/try_dup_spec.rb
ginst-2009.11.23 vendor/gems/extlib-0.9.13/spec/try_dup_spec.rb
rango-0.0.6 vendor/extlib/spec/try_dup_spec.rb
rango-0.1.pre vendor/extlib/spec/try_dup_spec.rb
middleman-0.10.17 vendor/gems/gems/extlib-0.9.13/spec/try_dup_spec.rb
middleman-0.10.16 vendor/gems/gems/extlib-0.9.13/spec/try_dup_spec.rb
middleman-0.10.15 vendor/gems/gems/extlib-0.9.13/spec/try_dup_spec.rb
middleman-0.10.14 vendor/gems/gems/extlib-0.9.13/spec/try_dup_spec.rb
ginst-2.0.1 vendor/gems/extlib-0.9.13/spec/try_dup_spec.rb
ginst-2.0.0 vendor/gems/extlib-0.9.13/spec/try_dup_spec.rb