Sha256: 2d3fd7ead96bfd040d4e7e948d9fb9e0a50d19955810fe13332b125ad04008bb

Contents?: true

Size: 663 Bytes

Versions: 35

Compression:

Stored size: 663 Bytes

Contents

require 'spec_helper'

RSpec.describe 'Lazy', type: :helper do
  subject { Torque::PostgreSQL::Attributes::Lazy }

  it 'is consider nil' do
    expect(subject.new(String, '')).to be_nil
  end

  it 'inspects as nil' do
    expect(subject.new(String, '').inspect).to be_eql('nil')
  end

  it 'compares to nil only' do
    expect(subject.new(String, '') == nil).to be_truthy
    expect(subject.new(String, '') == '').to be_falsey
    expect(subject.new(String, '') == 0).to be_falsey
  end

  it 'starts the object only on method call' do
    expect(subject.new(String, '').to_s).to be_a(String)
    expect(subject.new(String, '')).to respond_to(:chop)
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
torque-postgresql-3.4.1 spec/tests/lazy_spec.rb
torque-postgresql-2.4.5 spec/tests/lazy_spec.rb
torque-postgresql-3.4.0 spec/tests/lazy_spec.rb
torque-postgresql-3.3.3 spec/tests/lazy_spec.rb
torque-postgresql-2.4.4 spec/tests/lazy_spec.rb
torque-postgresql-3.3.2 spec/tests/lazy_spec.rb
torque-postgresql-2.4.3 spec/tests/lazy_spec.rb
torque-postgresql-3.3.1 spec/tests/lazy_spec.rb
torque-postgresql-3.3.0 spec/tests/lazy_spec.rb
torque-postgresql-3.2.2 spec/tests/lazy_spec.rb
torque-postgresql-2.4.2 spec/tests/lazy_spec.rb
torque-postgresql-2.4.1 spec/tests/lazy_spec.rb
torque-postgresql-3.2.1 spec/tests/lazy_spec.rb
torque-postgresql-2.4.0 spec/tests/lazy_spec.rb
torque-postgresql-3.2.0 spec/tests/lazy_spec.rb
torque-postgresql-3.1.0 spec/tests/lazy_spec.rb
torque-postgresql-2.3.0 spec/tests/lazy_spec.rb
torque-postgresql-3.0.1 spec/tests/lazy_spec.rb
torque-postgresql-2.2.4 spec/tests/lazy_spec.rb
torque-postgresql-3.0.0 spec/tests/lazy_spec.rb