Sha256: 05ff36e12d6894509cbd1580e8425513ca10b386cc5504115a296e78adf32294

Contents?: true

Size: 479 Bytes

Versions: 2

Compression:

Stored size: 479 Bytes

Contents

require_relative "../lib/null_plus"
require "minitest/autorun"

describe NullPlus do
  describe "Object#+@" do
    it "returns itself for non-null objects" do
      object = Object.new
      assert_equal object, +object
    end 

    it "returns nil for nil" do
      assert_equal nil, +nil
    end 

    it "returns nil for custom null objects" do
      null_object = Object.new
      def null_object.null?() true end 
      assert_equal nil, +null_object
    end 
  end 
end


Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
null_plus-1.0.1 spec/null_plus_spec.rb
null_plus-1.0.0 spec/null_plus_spec.rb