Sha256: f70f387e414671cf38fd9dbd34c219739bff0c4f1c7e6e2910f94ea415b56511

Contents?: true

Size: 702 Bytes

Versions: 1

Compression:

Stored size: 702 Bytes

Contents

require "spec_helper"

require "hamster/undefined"

describe Hamster::Undefined do

  describe "#erase" do

    describe "with Undefined" do

      before do
        @result = Hamster::Undefined.erase(Hamster::Undefined)
      end

      it "returns nil" do
        @result.should be_nil
      end

    end

    describe "with nil" do

      before do
        @result = Hamster::Undefined.erase(nil)
      end

      it "returns nil" do
        @result.should be_nil
      end

    end

    describe "otherwise" do

      before do
        @result = Hamster::Undefined.erase("Hello")
      end

      it "returns the value unchanged" do
        @result.should == "Hello"
      end

    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hamster-1.0.1.pre.rc.1 spec/hamster/undefined/erase_spec.rb