Sha256: 0a8b6c61c2b693b555ee143e292263d0cbc246adc15b8c5eedc68df2dde7dbbf
Contents?: true
Size: 892 Bytes
Versions: 1
Compression:
Stored size: 892 Bytes
Contents
# frozen_string_literal: true RSpec.describe ObjectExtensions do context 'when refining Object' do using ObjectExtensions describe '#blank?' do # An object is blank if it's false, empty, or a whitespace string. context 'for false' do it { expect(false.blank?).to eq(true) } end context 'for empty arrays' do it { expect([].blank?).to eq(true) } end context 'for empty hashes' do it { expect({}.blank?).to eq(true) } end context 'for whitespace string' do it { expect(''.blank?).to eq(true) } end end describe '#present?' do # An object is present if it's not blank. context 'for not blank objects' do it { expect(1.present?).to eq(true) } end context 'for blank objects' do it { expect(false.present?).to eq(false) } end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
finapps_core-2.0.14 | spec/core_extensions/object/blank_spec.rb |