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-2.2.3 spec/tests/lazy_spec.rb
torque-postgresql-2.2.2 spec/tests/lazy_spec.rb
torque-postgresql-2.2.1 spec/tests/lazy_spec.rb
torque-postgresql-2.2.0 spec/tests/lazy_spec.rb
torque-postgresql-2.1.3 spec/tests/lazy_spec.rb
torque-postgresql-2.1.2 spec/tests/lazy_spec.rb
torque-postgresql-2.1.1 spec/tests/lazy_spec.rb
torque-postgresql-2.1.0 spec/tests/lazy_spec.rb
torque-postgresql-2.0.6 spec/tests/lazy_spec.rb
torque-postgresql-2.0.5 spec/tests/lazy_spec.rb
torque-postgresql-2.0.4 spec/tests/lazy_spec.rb
torque-postgresql-2.0.3 spec/tests/lazy_spec.rb
torque-postgresql-2.0.2 spec/tests/lazy_spec.rb
torque-postgresql-2.0.1 spec/tests/lazy_spec.rb
torque-postgresql-2.0.0 spec/tests/lazy_spec.rb