Sha256: 1d597c5b8bf54b1e567f5353d86e641f4c1ce07a695c81b79fc42a6da8a3ddb6

Contents?: true

Size: 709 Bytes

Versions: 4

Compression:

Stored size: 709 Bytes

Contents

require 'spec_helper'

module CodeAnalyzer
  describe Nil do
    let(:core_nil) { Nil.new }

    context "to_s" do
      it "should return self" do
        expect(core_nil.to_s).to eq core_nil
      end
    end

    context "hash_size" do
      it "should return 0" do
        expect(core_nil.hash_size).to eq 0
      end
    end

    context "method_missing" do
      it "should return self" do
        expect(core_nil.undefined).to eq core_nil
      end
    end

    context "present?" do
      it "should return false" do
        expect(core_nil).not_to be_present
      end
    end

    context "blank?" do
      it "should return true" do
        expect(core_nil).to be_blank
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
code_analyzer-0.4.8 spec/code_analyzer/nil_spec.rb
code_analyzer-0.4.7 spec/code_analyzer/nil_spec.rb
code_analyzer-0.4.6 spec/code_analyzer/nil_spec.rb
code_analyzer-0.4.5 spec/code_analyzer/nil_spec.rb