Sha256: c8cf7a310cfea3535b4f776a42f7f2ff522caa971319362d666c660ce5f85824

Contents?: true

Size: 477 Bytes

Versions: 1

Compression:

Stored size: 477 Bytes

Contents

require 'spec_helper'

describe Gitlab::ObjectifiedHash do
  before do
    @hash = {a: 1, b: 2}
    @oh = Gitlab::ObjectifiedHash.new @hash
  end

  it "should objectify hash" do
    expect(@oh.a).to eq(@hash[:a])
    expect(@oh.b).to eq(@hash[:b])
  end

  describe "#to_hash" do
    it "should return an original hash" do
      expect(@oh.to_hash).to eq(@hash)
    end

    it "should have an alias #to_h" do
      expect(@oh.respond_to?(:to_h)).to be_true
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gitlab-3.1.0 spec/gitlab/objectified_hash_spec.rb