Sha256: 14a771a25f88d2482f8a39b202531799c9898f6497d7b994027b77766abfc02e

Contents?: true

Size: 672 Bytes

Versions: 32

Compression:

Stored size: 672 Bytes

Contents

require 'spec_helper'
require 'volt/extra_core/blank'

describe Object do
  it 'should add blank? to all objects' do
    expect(Object.new.blank?).to eq(false)
    expect(nil.blank?).to eq(true)
  end

  it 'should add present? to all objects' do
    expect(Object.new.present?).to eq(true)
    expect(nil.present?).to eq(false)
  end

  it 'should allow you to call .then to get a Promise with the object resolved' do
    promise = 5.then

    expect(promise.resolved?).to eq(true)
    expect(promise.value).to eq(5)
  end

  it 'should allow you to call .then with a block that will yield the promise' do
    5.then do |val|
      expect(val).to eq(5)
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
volt-0.9.7.pre8 spec/extra_core/object_spec.rb
volt-0.9.7.pre7 spec/extra_core/object_spec.rb
volt-0.9.7.pre6 spec/extra_core/object_spec.rb
volt-0.9.7.pre5 spec/extra_core/object_spec.rb
volt-0.9.7.pre3 spec/extra_core/object_spec.rb
volt-0.9.7.pre2 spec/extra_core/object_spec.rb
volt-0.9.6 spec/extra_core/object_spec.rb
volt-0.9.6.pre3 spec/extra_core/object_spec.rb
volt-0.9.6.pre2 spec/extra_core/object_spec.rb
volt-0.9.6.pre1 spec/extra_core/object_spec.rb
volt-0.9.5 spec/extra_core/object_spec.rb
volt-0.9.5.pre12 spec/extra_core/object_spec.rb
volt-0.9.5.pre11 spec/extra_core/object_spec.rb
volt-0.9.5.pre9 spec/extra_core/object_spec.rb
volt-0.9.5.pre8 spec/extra_core/object_spec.rb
volt-0.9.5.pre7 spec/extra_core/object_spec.rb
volt-0.9.5.pre6 spec/extra_core/object_spec.rb
volt-0.9.5.pre5 spec/extra_core/object_spec.rb
volt-0.9.5.pre4 spec/extra_core/object_spec.rb
volt-0.9.5.pre3 spec/extra_core/object_spec.rb