Sha256: 3677b97df179e329ab7d172d06a405832d9047cccf55d6f3c14ca44aada58589

Contents?: true

Size: 448 Bytes

Versions: 3

Compression:

Stored size: 448 Bytes

Contents

require 'spec_helper'
require 'inactive_support/object'

describe Object do

  describe "#ctry" do
    it "works with 1 argument" do
      "String".ctry(:downcase).should eq 'string'
    end

    it "works with multiple arguments" do
      "Nurse I spy gypsies run".ctry(:downcase, :reverse).should eq 'nur seispyg yps i esrun'
    end

    it 'returns nil when called on nil' do
      nil.ctry(:downcase, :upcase).should eq nil
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
inactive_support-1.1.0 spec/lib/object_spec.rb
inactive_support-1.0.0 spec/lib/object_spec.rb
inactive_support-0.1.0 spec/lib/object_spec.rb