Sha256: 1ad83cb1de1c1e00dc2385a293b6d54b8dcf3e09da9aad03799253def4f01004

Contents?: true

Size: 367 Bytes

Versions: 3

Compression:

Stored size: 367 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper'

describe Object do
  it 'should respond to the new methods' do
    Object.new.should respond_to(*%w(try tap))
  end

  it 'should return itself from tap' do
    a = Object.new
    a.tap { |s| }.should equal(a)
  end

  it 'should return nil from try if called on nil' do
    nil.try(1) { |a| }.should be_nil
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
darkhelmet-darkext-0.11.0 spec/object_spec.rb
darkhelmet-darkext-0.11.1 spec/object_spec.rb
darkhelmet-darkext-0.11.2 spec/object_spec.rb