Sha256: 52065250c644b48464500a1eaba0fa699d8ae12c4a524062b97f0683782e95ab

Contents?: true

Size: 990 Bytes

Versions: 39

Compression:

Stored size: 990 Bytes

Contents

# frozen_string_literal = true

RSpec.describe :is_blank do
  link :is_blank, from: :ree_object

  context "blank" do
    it {
      expect(is_blank(nil)). to be true
      expect(is_blank(false)). to be true
      expect(is_blank("")). to be true
      expect(is_blank("   ")). to be true
      expect(is_blank("  \n\t  \r ")). to be true
      expect(is_blank("  ")). to be true
      expect(is_blank("\u00a0")). to be true
      expect(is_blank([])). to be true
      expect(is_blank({})). to be true
      expect(is_blank(" ".encode("UTF-16LE"))).to be true
    }
  end

  context "not blank" do
    it {
      expect(is_blank(Object.new)).to be false
      expect(is_blank(true)).to be false
      expect(is_blank(0)).to be false
      expect(is_blank(1)).to be false
      expect(is_blank([nil])).to be false
      expect(is_blank({ nil => 0 })).to be false
      expect(is_blank(Time.now)).to be false
      expect(is_blank("my value".encode("UTF-16LE"))).to be false
    }
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
ree_lib-1.0.39 lib/ree_lib/packages/ree_object/spec/ree_object/functions/is_blank_spec.rb
ree_lib-1.0.38 lib/ree_lib/packages/ree_object/spec/ree_object/functions/is_blank_spec.rb
ree_lib-1.0.37 lib/ree_lib/packages/ree_object/spec/ree_object/functions/is_blank_spec.rb
ree_lib-1.0.36 lib/ree_lib/packages/ree_object/spec/ree_object/functions/is_blank_spec.rb
ree_lib-1.0.35 lib/ree_lib/packages/ree_object/spec/ree_object/functions/is_blank_spec.rb
ree_lib-1.0.34 lib/ree_lib/packages/ree_object/spec/ree_object/functions/is_blank_spec.rb
ree_lib-1.0.33 lib/ree_lib/packages/ree_object/spec/ree_object/functions/is_blank_spec.rb
ree_lib-1.0.32 lib/ree_lib/packages/ree_object/spec/ree_object/functions/is_blank_spec.rb
ree_lib-1.0.31 lib/ree_lib/packages/ree_object/spec/ree_object/functions/is_blank_spec.rb
ree_lib-1.0.30 lib/ree_lib/packages/ree_object/spec/ree_object/functions/is_blank_spec.rb
ree_lib-1.0.29 lib/ree_lib/packages/ree_object/spec/ree_object/functions/is_blank_spec.rb
ree_lib-1.0.28 lib/ree_lib/packages/ree_object/spec/ree_object/functions/is_blank_spec.rb
ree_lib-1.0.27 lib/ree_lib/packages/ree_object/spec/ree_object/functions/is_blank_spec.rb
ree_lib-1.0.26 lib/ree_lib/packages/ree_object/spec/ree_object/functions/is_blank_spec.rb
ree_lib-1.0.24 lib/ree_lib/packages/ree_object/spec/ree_object/functions/is_blank_spec.rb
ree_lib-1.0.23 lib/ree_lib/packages/ree_object/spec/ree_object/functions/is_blank_spec.rb
ree_lib-1.0.22 lib/ree_lib/packages/ree_object/spec/ree_object/functions/is_blank_spec.rb
ree_lib-1.0.21 lib/ree_lib/packages/ree_object/spec/ree_object/functions/is_blank_spec.rb
ree_lib-1.0.20 lib/ree_lib/packages/ree_object/spec/ree_object/functions/is_blank_spec.rb
ree_lib-1.0.19 lib/ree_lib/packages/ree_object/spec/ree_object/functions/is_blank_spec.rb