Sha256: 935d8a1db30e31d044433dbe02248078b460b429fb9aaf3c0de0161d94300f87

Contents?: true

Size: 671 Bytes

Versions: 5

Compression:

Stored size: 671 Bytes

Contents

# coding: utf-8

require 'test/unit/helper'

describe 'String#blank?' do
  it 'should return the true value if self is empty' do
    ''.blank?.must_equal true
    "".blank?.must_equal true
  end
  
  it 'should return the false value if self is not empty' do
    [' ', ' ', 'string', '日本語'].each do |v|
      v.blank?.must_equal false
    end
  end
end

describe 'NilClass#blank?' do
  it 'should always return the true value' do
    nil.blank?.must_equal true
  end
end

describe 'OtherClasses#blank?' do
  it 'should always return the false value' do
    [0, 1, -1, 9.99, true, false, ::Time.now].each do |v|
      v.blank?.must_equal false
    end
  end  
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
thinreports-0.7.7 test/unit/core/ext/object_spec.rb
thinreports-0.7.6 test/unit/core/ext/object_spec.rb
thinreports-0.7.5 test/unit/core/ext/object_spec.rb
thinreports-0.7.0 test/unit/core/ext/object_spec.rb
thinreports-0.6.0.pre3 test/unit/core/ext/object_spec.rb