Sha256: 7767f9c5afbf048210bdc69a80b714c658cc35a51a70926eb406623a9bd90123

Contents?: true

Size: 475 Bytes

Versions: 1

Compression:

Stored size: 475 Bytes

Contents

require 'spec_helper'

describe Brat::ObjectifiedHash do
  before do
    @hash = {a: 1, b: 2}
    @oh = Brat::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_truthy
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
brat-0.1.1 spec/brat/objectified_hash_spec.rb