Sha256: 72018d62f054f916c5468d7c2bf2fd47522fb8032ea557f67905afe8779b641a

Contents?: true

Size: 1012 Bytes

Versions: 39

Compression:

Stored size: 1012 Bytes

Contents

# frozen_string_literal = true

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

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

  context "not blank" do
    it {
      expect(not_blank(Object.new)).to be true
      expect(not_blank(true)).to be true
      expect(not_blank(0)).to be true
      expect(not_blank(1)).to be true
      expect(not_blank([nil])).to be true
      expect(not_blank({ nil => 0 })).to be true
      expect(not_blank(Time.now)).to be true
      expect(not_blank("my value".encode("UTF-16LE"))).to be true
    }
  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/not_blank_spec.rb
ree_lib-1.0.38 lib/ree_lib/packages/ree_object/spec/ree_object/functions/not_blank_spec.rb
ree_lib-1.0.37 lib/ree_lib/packages/ree_object/spec/ree_object/functions/not_blank_spec.rb
ree_lib-1.0.36 lib/ree_lib/packages/ree_object/spec/ree_object/functions/not_blank_spec.rb
ree_lib-1.0.35 lib/ree_lib/packages/ree_object/spec/ree_object/functions/not_blank_spec.rb
ree_lib-1.0.34 lib/ree_lib/packages/ree_object/spec/ree_object/functions/not_blank_spec.rb
ree_lib-1.0.33 lib/ree_lib/packages/ree_object/spec/ree_object/functions/not_blank_spec.rb
ree_lib-1.0.32 lib/ree_lib/packages/ree_object/spec/ree_object/functions/not_blank_spec.rb
ree_lib-1.0.31 lib/ree_lib/packages/ree_object/spec/ree_object/functions/not_blank_spec.rb
ree_lib-1.0.30 lib/ree_lib/packages/ree_object/spec/ree_object/functions/not_blank_spec.rb
ree_lib-1.0.29 lib/ree_lib/packages/ree_object/spec/ree_object/functions/not_blank_spec.rb
ree_lib-1.0.28 lib/ree_lib/packages/ree_object/spec/ree_object/functions/not_blank_spec.rb
ree_lib-1.0.27 lib/ree_lib/packages/ree_object/spec/ree_object/functions/not_blank_spec.rb
ree_lib-1.0.26 lib/ree_lib/packages/ree_object/spec/ree_object/functions/not_blank_spec.rb
ree_lib-1.0.24 lib/ree_lib/packages/ree_object/spec/ree_object/functions/not_blank_spec.rb
ree_lib-1.0.23 lib/ree_lib/packages/ree_object/spec/ree_object/functions/not_blank_spec.rb
ree_lib-1.0.22 lib/ree_lib/packages/ree_object/spec/ree_object/functions/not_blank_spec.rb
ree_lib-1.0.21 lib/ree_lib/packages/ree_object/spec/ree_object/functions/not_blank_spec.rb
ree_lib-1.0.20 lib/ree_lib/packages/ree_object/spec/ree_object/functions/not_blank_spec.rb
ree_lib-1.0.19 lib/ree_lib/packages/ree_object/spec/ree_object/functions/not_blank_spec.rb